[compiler-rt] r220506 - Change all of the build flags to switch /MD and /MDd into /MT, instead of just some of the targets. Fixes PR21241.
Aaron Ballman
aaron at aaronballman.com
Thu Oct 23 13:24:00 PDT 2014
Author: aaronballman
Date: Thu Oct 23 15:24:00 2014
New Revision: 220506
URL: http://llvm.org/viewvc/llvm-project?rev=220506&view=rev
Log:
Change all of the build flags to switch /MD and /MDd into /MT, instead of just some of the targets. Fixes PR21241.
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=220506&r1=220505&r2=220506&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Oct 23 15:24:00 2014
@@ -246,10 +246,15 @@ if(MSVC)
# 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(REPLACE "/MDd" "/MT" CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG}")
- string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE
- "${CMAKE_CXX_FLAGS_RELEASE}")
+ foreach(flag_var
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ if(${flag_var} MATCHES "/MD")
+ string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+ elseif(${flag_var} MATCHES "/MDd")
+ string(REGEX REPLACE "/MDd" "/MT" ${flag_var} "${${flag_var}}")
+ endif()
+ endforeach()
endif()
append_list_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS)
append_list_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS)
More information about the llvm-commits
mailing list