summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTUtils.cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-12-09 22:45:03 +0000
committerChris Bieneman <beanz@apple.com>2015-12-09 22:45:03 +0000
commit7fbd9917dcc3cb590205331b82d8efc7322de09b (patch)
treed739b38cd8e4037d64487ed66f26b5bc83437860 /cmake/Modules/CompilerRTUtils.cmake
parent30373afde77e6540e2768c164142af7d716cdb03 (diff)
[CMake] Provide options for toggling on and off various runtime libraries.
Summary: Rather than having to add new "experimental" options each time someone wants to work on bringing a sanitizer to a new platform, this patch makes options for all of them. The default values for the options are set by the platform checks that would have enabled them, but they can be overridden on or off. Reviewers: kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14846 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index cf690f4a3..f9c7f0fed 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -36,6 +36,16 @@ macro(append_list_if condition value)
endif()
endmacro()
+# Appends values to list if it isn't already there
+macro(append_list_unique list)
+ foreach(val ${ARGN})
+ list(FIND ${list} ${val} idx)
+ if(idx EQUAL -1)
+ list(APPEND ${list} ${val})
+ endif()
+ endforeach()
+endmacro()
+
# Appends value to all strings in ARGN, if the condition is true.
macro(append_string_if condition value)
if(${condition})
@@ -67,3 +77,12 @@ macro(list_union output input1 input2)
endif()
endforeach()
endmacro()
+
+macro(check_list_contains outvar list input)
+ list(FIND ${list} ${input} idx)
+ if(idx GREATER -1)
+ set(${outvar} True)
+ else()
+ set(${outvar} False)
+ endif()
+endmacro()