diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-12-27 13:19:23 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-12-27 13:19:23 +0000 |
commit | c20f5d2246ad445a91cd4e190502b7909700cb86 (patch) | |
tree | 5056832459e193e70c23d7cbb7da9927ef33812a /compiler-rt/CMakeLists.txt | |
parent | 3edd52c1d04968daaae289c77f47c6a6cd00ca28 (diff) | |
download | bcm5719-llvm-c20f5d2246ad445a91cd4e190502b7909700cb86.tar.gz bcm5719-llvm-c20f5d2246ad445a91cd4e190502b7909700cb86.zip |
Define COMPILER_RT_CAN_EXECUTE_TESTS variable on platforms where we can produce working binaries and use it in build rules for sanitizers tests
llvm-svn: 171160
Diffstat (limited to 'compiler-rt/CMakeLists.txt')
-rw-r--r-- | compiler-rt/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 8574cdc245f..0c9f2a624b8 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -66,6 +66,15 @@ 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}") +# We only support running instrumented tests when we're not cross compiling +# and target a unix-like system. On Android we define the rules for building +# unit tests, but don't execute them. +if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX AND NOT ANDROID) + set(COMPILER_RT_CAN_EXECUTE_TESTS TRUE) +else() + set(COMPILER_RT_CAN_EXECUTE_TESTS FALSE) +endif() + function(filter_available_targets out_var) set(archs) foreach(arch ${ARGN}) |