summaryrefslogtreecommitdiffstats
path: root/compiler-rt/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-08-10 14:45:52 +0000
committerAlexey Samsonov <samsonov@google.com>2012-08-10 14:45:52 +0000
commitfb844c7effdb52dd9fdcc391be28c940ccbf487b (patch)
tree43a76df3f6a9ea5ef6069e25d29cab0aae2794d3 /compiler-rt/CMakeLists.txt
parentea7d906b0ffff918a7d98c8b6c1f74e3c38cf23b (diff)
downloadbcm5719-llvm-fb844c7effdb52dd9fdcc391be28c940ccbf487b.tar.gz
bcm5719-llvm-fb844c7effdb52dd9fdcc391be28c940ccbf487b.zip
[ASan] CMake support for building ASan runtime as a universal binary on Mac
llvm-svn: 161665
Diffstat (limited to 'compiler-rt/CMakeLists.txt')
-rw-r--r--compiler-rt/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index d8985c216b4..a7d9a89508d 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -48,6 +48,18 @@ try_compile(CAN_TARGET_I386 ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE32}
COMPILE_DEFINITIONS "${TARGET_I386_CFLAGS}"
CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_I386_CFLAGS}")
+function(filter_available_targets out_var)
+ set(archs)
+ foreach(arch ${ARGN})
+ if(${arch} STREQUAL "x86_64" AND CAN_TARGET_X86_64)
+ list(APPEND archs ${arch})
+ elseif (${arch} STREQUAL "i386" AND CAN_TARGET_I386)
+ list(APPEND archs ${arch})
+ endif()
+ endforeach()
+ set(${out_var} ${archs} PARENT_SCOPE)
+endfunction()
+
# Because compiler-rt spends a lot of time setting up custom compile flags,
# define a handy helper function for it. The compile flags setting in CMake
# has serious issues that make its syntax challenging at best.
OpenPOWER on IntegriCloud