forked from OSchip/llvm-project
[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:
parent
c483808785
commit
45ebaf1840
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue