[compiler-rt] r203798 - [CMake] More fixes for Windows build
Alexey Samsonov
samsonov at google.com
Thu Mar 13 06:37:08 PDT 2014
Author: samsonov
Date: Thu Mar 13 08:37:07 2014
New Revision: 203798
URL: http://llvm.org/viewvc/llvm-project?rev=203798&view=rev
Log:
[CMake] More fixes for Windows build
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=203798&r1=203797&r2=203798&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Mar 13 08:37:07 2014
@@ -264,20 +264,17 @@ append_if(COMPILER_RT_HAS_FNO_FUNCTION_S
if(MSVC)
# Remove /MD flag so that it doesn't conflict with /MT.
if(COMPILER_RT_HAS_MT_FLAG)
- string(REGEX REPLACE "(^| ) */MD *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REGEX REPLACE "(^| ) */MDd? *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
list(APPEND SANITIZER_COMMON_CFLAGS /MT)
endif()
append_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS)
append_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS)
endif()
-# Build with optimization, unless we're in debug mode.
-if(NOT COMPILER_RT_DEBUG)
- if(MSVC)
- list(APPEND SANITIZER_COMMON_CFLAGS /O2)
- else()
- list(APPEND SANITIZER_COMMON_CFLAGS -O3)
- endif()
+# Build with optimization, unless we're in debug mode. If we're using MSVC,
+# always respect the optimization flags set by CMAKE_BUILD_TYPE instead.
+if(NOT COMPILER_RT_DEBUG AND NOT MSVC)
+ list(APPEND SANITIZER_COMMON_CFLAGS -O3)
endif()
# Build sanitizer runtimes with debug info.
More information about the llvm-commits
mailing list