From 272eef9a5b2d7f63eafc8a6c476a538d6204ad7e Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 15 May 2014 16:33:58 +0000 Subject: Exclude MSVC to try to unbreak their builds. We have a bad skew between how CMake drives a windows link and how our custom command does. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208903 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/Modules/AddCompilerRT.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cmake') diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 549df4d9e..69c30e364 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -136,8 +136,16 @@ macro(add_compiler_rt_test test_suite test_name) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TEST_DEPS clang) endif() - set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}") - separate_arguments(TEST_LINK_FLAGS) + # If we're not on MSVC, include the linker flags from CMAKE but override them + # with the provided link flags. This ensures that flags which are required to + # link programs at all are included, but the changes needed for the test + # trump. With MSVC we can't do that because CMake is set up to run link.exe + # when linking, not the compiler. Here, we hack it to use the compiler + # because we want to use -fsanitize flags. + if(NOT MSVC) + set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}") + separate_arguments(TEST_LINK_FLAGS) + endif() add_custom_target(${test_name} # MSVS CL doesn't allow a space between -Fe and the output file name. COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} -- cgit v1.2.3