diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-05-15 16:33:58 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-05-15 16:33:58 +0000 |
commit | 332e1b1909a79655ddf4f2c6d777cc6839129cb1 (patch) | |
tree | 08bccd028fdde3977c540a58c3c2ba0a44008845 | |
parent | 597122b02634ba39c4ac3e21bef110e95866eec5 (diff) | |
download | bcm5719-llvm-332e1b1909a79655ddf4f2c6d777cc6839129cb1.tar.gz bcm5719-llvm-332e1b1909a79655ddf4f2c6d777cc6839129cb1.zip |
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.
llvm-svn: 208903
-rw-r--r-- | compiler-rt/cmake/Modules/AddCompilerRT.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index 549df4d9e01..69c30e364cd 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/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} |