llvm.org GIT mirror llvm / e258845
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194589 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 5 years ago
1 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
44 include(AddLLVMDefinitions)
55 include(CheckCCompilerFlag)
66 include(CheckCXXCompilerFlag)
7 include(LLVMProcessSources)
78
89 if( CMAKE_COMPILER_IS_GNUCXX )
910 set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
3839 endif()
3940 endif()
4041 endif()
42
43 if(MSVC)
44 # Link release builds against the static runtime.
45 foreach(flag CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
46 CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE
47 CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL)
48 llvm_replace_compiler_option("${flag}" "/MD" "/MT")
49 endforeach()
50 endif()
4151
4252 if(WIN32)
4353 if(CYGWIN)