[compiler-rt] r208903 - Exclude MSVC to try to unbreak their builds. We have a bad skew between

Chandler Carruth chandlerc at gmail.com
Thu May 15 09:33:58 PDT 2014


Author: chandlerc
Date: Thu May 15 11:33:58 2014
New Revision: 208903

URL: http://llvm.org/viewvc/llvm-project?rev=208903&view=rev
Log:
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.

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=208903&r1=208902&r2=208903&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Thu May 15 11:33:58 2014
@@ -136,8 +136,16 @@ macro(add_compiler_rt_test test_suite te
   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}





More information about the llvm-commits mailing list