aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTUtils.cmake
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2013-05-27 18:27:12 +0000
committerEd Schouten <ed@FreeBSD.org>2013-05-27 18:27:12 +0000
commit11023dc647fd8f41418da90d59db138400d0f334 (patch)
tree50f0ab80515576749ef638dd0766b70a65904bfa /cmake/Modules/CompilerRTUtils.cmake
parent58aabf08b77d221489f10e274812ec60917c21a8 (diff)
downloadsrc-11023dc647fd8f41418da90d59db138400d0f334.tar.gz
src-11023dc647fd8f41418da90d59db138400d0f334.zip
Import compiler-rt r182741.vendor/compiler-rt/compiler-rt-r182741
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=251034 svn path=/vendor/compiler-rt/compiler-rt-r182741/; revision=251036; tag=vendor/compiler-rt/compiler-rt-r182741
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index 50f068091e64..f9760f40dbd5 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -15,3 +15,14 @@ function(set_target_link_flags target)
set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}")
endfunction()
+# Check if a given flag is present in a space-separated flag_string.
+# Store the result in out_var.
+function(find_flag_in_string flag_string flag out_var)
+ string(REPLACE " " ";" flag_list ${flag_string})
+ list(FIND flag_list ${flag} flag_pos)
+ if(NOT flag_pos EQUAL -1)
+ set(${out_var} TRUE PARENT_SCOPE)
+ else()
+ set(${out_var} FALSE PARENT_SCOPE)
+ endif()
+endfunction()