summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-05-15 16:33:58 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-05-15 16:33:58 +0000
commit272eef9a5b2d7f63eafc8a6c476a538d6204ad7e (patch)
tree8d602c253fa696968010c2929469202f6b05d7e0
parent2d53385ccf252adcc71de2d1fb28eeeb65af1f79 (diff)
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
-rw-r--r--cmake/Modules/AddCompilerRT.cmake12
1 files changed, 10 insertions, 2 deletions
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}