1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

cmake: link release builds statically against run-time library on windows (use /MT instead of /MD)

This should fix the problem of snapshot builds created with MSVC 2012 not
working for users with MSVC 2010, etc.

Differential Revision: http://llvm-reviews.chandlerc.com/D2157

llvm-svn: 194589
This commit is contained in:
Hans Wennborg 2013-11-13 18:16:23 +00:00
parent 2d9d6fff7c
commit e4d2a9b940

View File

@ -5,6 +5,7 @@
include(AddLLVMDefinitions)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(LLVMProcessSources)
if( CMAKE_COMPILER_IS_GNUCXX )
set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
@ -40,6 +41,15 @@ else()
endif()
endif()
if(MSVC)
# Link release builds against the static runtime.
foreach(flag CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL)
llvm_replace_compiler_option("${flag}" "/MD" "/MT")
endforeach()
endif()
if(WIN32)
if(CYGWIN)
set(LLVM_ON_WIN32 0)