[CMake] Introduce COMPILER_RT_INCLUDE_TESTS option

llvm-svn: 201666
This commit is contained in:
Alexey Samsonov 2014-02-19 11:18:47 +00:00
parent 6d3df420d2
commit cd8535a96d
8 changed files with 12 additions and 9 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -73,6 +73,6 @@ endif()
add_dependencies(compiler-rt tsan)
if(LLVM_INCLUDE_TESTS)
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
endif()

View File

@ -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()

View File

@ -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)

View File

@ -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)