Fix sanitizer tests with LLVM_TOOL_LLD_BUILD=OFF.

Only depend on LLD if it is going to be built.

llvm-svn: 298174
This commit is contained in:
Evgeniy Stepanov 2017-03-18 00:25:43 +00:00
parent 7453bb7940
commit 0e6cb1925c
4 changed files with 7 additions and 7 deletions

View File

@ -253,12 +253,12 @@ else()
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)
if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD)
set(COMPILER_RT_HAS_LLD TRUE)
else()
set(COMPILER_RT_HAS_LLD_SOURCES FALSE)
set(COMPILER_RT_HAS_LLD FALSE)
endif()
pythonize_bool(COMPILER_RT_HAS_LLD_SOURCES)
pythonize_bool(COMPILER_RT_HAS_LLD)
add_subdirectory(lib)

View File

@ -16,7 +16,7 @@ endmacro()
set(ASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND ASAN_TEST_DEPS asan)
if(NOT APPLE AND COMPILER_RT_HAS_LLD_SOURCES)
if(NOT APPLE AND COMPILER_RT_HAS_LLD)
list(APPEND ASAN_TEST_DEPS
lld
)

View File

@ -34,7 +34,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)
LTO
)
endif()
if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES)
if(WIN32 AND COMPILER_RT_HAS_LLD)
list(APPEND CFI_TEST_DEPS
lld
)

View File

@ -26,7 +26,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@)
set_default("has_lld", @COMPILER_RT_HAS_LLD_PYBOOL@)
set_default("can_symbolize", @CAN_SYMBOLIZE@)
config.available_features.add('target-is-%s' % config.target_arch)