diff options
author | Chris Bieneman <beanz@apple.com> | 2015-09-28 17:38:44 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-09-28 17:38:44 +0000 |
commit | b850f314fdc2e3ed03e9bc9b77e41ee246c8f738 (patch) | |
tree | fabc2051f26265044ee9b61c7f6159de20ec2072 /cmake/Modules/CompilerRTDarwinUtils.cmake | |
parent | 985df07e9e3c41cf3417fde0954bebe388f9b195 (diff) |
[CMake] [Darwin] Make darwin_filter_builtin_sources support both whitelist and blacklist filtering.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248720 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTDarwinUtils.cmake')
-rw-r--r-- | cmake/Modules/CompilerRTDarwinUtils.cmake | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake index 696c39773..466dc04f5 100644 --- a/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -204,12 +204,22 @@ endfunction() # Filter out generic versions of routines that are re-implemented in # architecture specific manner. This prevents multiple definitions of the # same symbols, making the symbol selection non-deterministic. -function(darwin_filter_builtin_sources output_var excluded_list) +function(darwin_filter_builtin_sources output_var exclude_or_include excluded_list) + if(exclude_or_include STREQUAL "EXCLUDE") + set(filter_action GREATER) + set(filter_value -1) + elseif(exclude_or_include STREQUAL "INCLUDE") + set(filter_action LESS) + set(filter_value 0) + else() + message(FATAL_ERROR "darwin_filter_builtin_sources called without EXCLUDE|INCLUDE") + endif() + set(intermediate ${ARGN}) foreach (_file ${intermediate}) get_filename_component(_name_we ${_file} NAME_WE) list(FIND ${excluded_list} ${_name_we} _found) - if(_found GREATER -1) + if(_found ${filter_action} ${filter_value}) list(REMOVE_ITEM intermediate ${_file}) elseif(${_file} MATCHES ".*/.*\\.S") get_filename_component(_name ${_file} NAME) @@ -256,7 +266,9 @@ macro(darwin_add_builtin_libraries) ARCH ${arch} MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER}) - darwin_filter_builtin_sources(filtered_sources ${arch}_${os}_EXCLUDED_BUILTINS ${${arch}_SOURCES}) + darwin_filter_builtin_sources(filtered_sources + EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS + ${${arch}_SOURCES}) darwin_add_builtin_library(clang_rt builtins OS ${os} |