From 2b23fdcc97d60b5fa2f6d1280a7132a82e35c815 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 19 Aug 2016 15:13:21 +0000 Subject: 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 --- cmake/Modules/CompilerRTUtils.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmake/Modules/CompilerRTUtils.cmake') 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}}) -- cgit v1.2.3