summaryrefslogtreecommitdiff
path: root/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
commitfe51abb4949ad9976168bf53edb52c20016b9a0d (patch)
treee32bd6d8a916d5e1dee7e77131e0257a77890692 /CMakeLists.txt
parent79fc3c042bbe8348fb6f3bff7a5575e4425e5a38 (diff)
downloadcompiler-rt-fe51abb4949ad9976168bf53edb52c20016b9a0d.tar.gz
compiler-rt-fe51abb4949ad9976168bf53edb52c20016b9a0d.tar.bz2
compiler-rt-fe51abb4949ad9976168bf53edb52c20016b9a0d.tar.xz
[ASan] CMake support for building ASan runtime as a universal binary on Mac
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8985c21..a7d9a895 100644
--- a/CMakeLists.txt
+++ b/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.