summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-12-27 13:19:23 +0000
committerAlexey Samsonov <samsonov@google.com>2012-12-27 13:19:23 +0000
commitd7d7b5f39cf5bbc36403afb0a94d473519c7ab78 (patch)
tree09cc13f0ae2e396c276b0b8fd19866e1be100100 /CMakeLists.txt
parent4b8fb65802eb47564fbbd4dee1d3e40d892837fe (diff)
downloadcompiler-rt-d7d7b5f39cf5bbc36403afb0a94d473519c7ab78.tar.gz
compiler-rt-d7d7b5f39cf5bbc36403afb0a94d473519c7ab78.tar.bz2
compiler-rt-d7d7b5f39cf5bbc36403afb0a94d473519c7ab78.tar.xz
Define COMPILER_RT_CAN_EXECUTE_TESTS variable on platforms where we can produce working binaries and use it in build rules for sanitizers tests
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8574cdc2..0c9f2a62 100644
--- a/CMakeLists.txt
+++ b/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})