diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | lib/asan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/msan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/sanitizer_common/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/tsan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/asan/CMakeLists.txt | 4 | ||||
-rw-r--r-- | test/msan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/tsan/CMakeLists.txt | 2 |
8 files changed, 12 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c5420516a..eebb2aa63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,12 +38,15 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) # Setup the paths where compiler-rt runtimes and headers should be stored. set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." + ${LLVM_INCLUDE_TESTS}) else() # Take output dir and install path from the user. set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path where built compiler-rt libraries should be stored.") set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH "Path where built compiler-rt libraries should be installed.") + option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF) set(LLVM_CONFIG_PATH "" CACHE PATH "Path to llvm-config binary") if (NOT LLVM_CONFIG_PATH) @@ -296,7 +299,7 @@ endif() add_subdirectory(lib) -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(unittests) endif() add_subdirectory(test) diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt index 813e55ace..4f4aefa57 100644 --- a/lib/asan/CMakeLists.txt +++ b/lib/asan/CMakeLists.txt @@ -135,6 +135,6 @@ add_compiler_rt_resource_file(asan_blacklist asan_blacklist.txt) add_dependencies(asan asan_blacklist) add_dependencies(compiler-rt asan) -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() diff --git a/lib/msan/CMakeLists.txt b/lib/msan/CMakeLists.txt index 76a122e94..d12275dd0 100644 --- a/lib/msan/CMakeLists.txt +++ b/lib/msan/CMakeLists.txt @@ -37,6 +37,6 @@ add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt) add_dependencies(msan msan_blacklist) add_dependencies(compiler-rt msan) -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() diff --git a/lib/sanitizer_common/CMakeLists.txt b/lib/sanitizer_common/CMakeLists.txt index 75f4fcc0a..c62776d31 100644 --- a/lib/sanitizer_common/CMakeLists.txt +++ b/lib/sanitizer_common/CMakeLists.txt @@ -137,6 +137,6 @@ endif() add_dependencies(compiler-rt sanitizer_common) # Unit tests for common sanitizer runtime. -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() diff --git a/lib/tsan/CMakeLists.txt b/lib/tsan/CMakeLists.txt index 5b1ceb187..6678ebc07 100644 --- a/lib/tsan/CMakeLists.txt +++ b/lib/tsan/CMakeLists.txt @@ -73,6 +73,6 @@ endif() add_dependencies(compiler-rt tsan) -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(tests) endif() diff --git a/test/asan/CMakeLists.txt b/test/asan/CMakeLists.txt index aaf315a70..1ba0e3d86 100644 --- a/test/asan/CMakeLists.txt +++ b/test/asan/CMakeLists.txt @@ -39,7 +39,7 @@ if(CAN_TARGET_i386) list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/32bitConfig) endif() -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg @@ -53,7 +53,7 @@ set(ASAN_TEST_DEPS set(ASAN_TEST_PARAMS asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) # FIXME: support unit test in the android test runner -if(LLVM_INCLUDE_TESTS AND NOT CAN_TARGET_arm_android) +if(COMPILER_RT_INCLUDE_TESTS AND NOT CAN_TARGET_arm_android) list(APPEND ASAN_TEST_DEPS AsanUnitTests) list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit) endif() diff --git a/test/msan/CMakeLists.txt b/test/msan/CMakeLists.txt index 3387f8291..aa29f3594 100644 --- a/test/msan/CMakeLists.txt +++ b/test/msan/CMakeLists.txt @@ -8,7 +8,7 @@ set(MSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} msan) -if(LLVM_INCLUDE_TESTS AND COMPILER_RT_HAS_LIBCXX_SOURCES) +if(COMPILER_RT_INCLUDE_TESTS AND COMPILER_RT_HAS_LIBCXX_SOURCES) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) diff --git a/test/tsan/CMakeLists.txt b/test/tsan/CMakeLists.txt index 8d79c705d..4e7160e99 100644 --- a/test/tsan/CMakeLists.txt +++ b/test/tsan/CMakeLists.txt @@ -6,7 +6,7 @@ set(TSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} tsan) -if(LLVM_INCLUDE_TESTS) +if(COMPILER_RT_INCLUDE_TESTS) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg) |