[cmake] Hoist check for LLD sources up into root CMakeLists.txt

We will use this for ASan on Windows soon. When the ELF port of LLD
matures, we can add other sanitizer integration tests to make sure they
work with LLD.

llvm-svn: 244549
This commit is contained in:
Reid Kleckner 2015-08-11 00:33:07 +00:00
parent c483808785
commit 45ebaf1840
4 changed files with 14 additions and 1 deletions

View File

@ -355,6 +355,14 @@ else()
set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE)
endif()
set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)
if(EXISTS ${COMPILER_RT_LLD_PATH}/)
set(COMPILER_RT_HAS_LLD_SOURCES TRUE)
else()
set(COMPILER_RT_HAS_LLD_SOURCES FALSE)
endif()
pythonize_bool(COMPILER_RT_HAS_LLD_SOURCES)
add_subdirectory(lib)
if(COMPILER_RT_INCLUDE_TESTS)

View File

@ -19,7 +19,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)
LTO
)
endif()
if(WIN32 AND EXISTS ${CMAKE_SOURCE_DIR}/tools/lld)
if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES)
list(APPEND CFI_TEST_DEPS
lld
)

View File

@ -106,6 +106,10 @@ sanitizer_can_use_cxxabi = getattr(config, 'sanitizer_can_use_cxxabi', True)
if sanitizer_can_use_cxxabi:
config.available_features.add('cxxabi')
# Test lld if it is available.
if config.has_lld:
config.available_features.add('lld')
lit.util.usePlatformSdkOnDarwin(config, lit_config)
def is_darwin_lto_supported():

View File

@ -28,6 +28,7 @@ set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")
set_default("emulator", "@COMPILER_RT_EMULATOR@")
set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@)
set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@)
# LLVM tools dir can be passed in lit parameters, so try to
# apply substitution.