[compiler-rt] r215435 - [ASan/Win] Fix PR18987: warning about overriding '/MD' with '/MT'
Timur Iskhodzhanov
timurrrr at google.com
Tue Aug 12 02:44:56 PDT 2014
Author: timurrrr
Date: Tue Aug 12 04:44:56 2014
New Revision: 215435
URL: http://llvm.org/viewvc/llvm-project?rev=215435&view=rev
Log:
[ASan/Win] Fix PR18987: warning about overriding '/MD' with '/MT'
Modified:
compiler-rt/trunk/CMakeLists.txt
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=215435&r1=215434&r2=215435&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Tue Aug 12 04:44:56 2014
@@ -241,10 +241,13 @@ append_if(COMPILER_RT_HAS_FVISIBILITY_HI
append_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections SANITIZER_COMMON_CFLAGS)
if(MSVC)
- # Remove /MD flag so that it doesn't conflict with /MT.
+ # Replace the /MD[d] flags with /MT.
+ # FIXME: In fact, sanitizers should support both /MT and /MD, see PR20214.
if(COMPILER_RT_HAS_MT_FLAG)
- string(REGEX REPLACE "(^| ) */MDd? *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- list(APPEND SANITIZER_COMMON_CFLAGS /MT)
+ string(REPLACE "/MDd" "/MT" CMAKE_CXX_FLAGS_DEBUG
+ "${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE
+ "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
append_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS)
append_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS)
More information about the llvm-commits
mailing list