summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTUtils.cmake
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-08-19 15:13:21 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-08-19 15:13:21 +0000
commit2b23fdcc97d60b5fa2f6d1280a7132a82e35c815 (patch)
tree079536090daa51e8f1d0c79682ee0df6beb6ece3 /cmake/Modules/CompilerRTUtils.cmake
parent9f3462bee804f1ee1c17509c9e5adb8255b548d2 (diff)
build: allow building a specific set of sanitizers
Introduce a new CMake option `COMPILER_RT_SANITIZERS_TO_BUILD` which takes either a special token `all` (default) which will preserve the current behaviour or a CMake list of sanitizers to build. It will still perform the normal checks if the sanitizer is requested. It only permits a further means to exclude a particular sanitizer. This gives finer grained control than `COMPILER_RT_BUILD_SANITIZERS` which only gives an all or nothing control. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279253 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index 25692974b..af5975f02 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -76,6 +76,18 @@ macro(list_intersect output input1 input2)
endforeach()
endmacro()
+function(list_replace input_list old new)
+ set(replaced_list)
+ foreach(item ${${input_list}})
+ if(${item} STREQUAL ${old})
+ list(APPEND replaced_list ${new})
+ else()
+ list(APPEND replaced_list ${item})
+ endif()
+ endforeach()
+ set(${input_list} "${replaced_list}" PARENT_SCOPE)
+endfunction()
+
# Takes ${ARGN} and puts only supported architectures in @out_var list.
function(filter_available_targets out_var)
set(archs ${${out_var}})