diff options
| author | Hans Wennborg <hans@hanshq.net> | 2013-11-13 19:12:02 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2013-11-13 19:12:02 +0000 |
| commit | fc59812bee11fe53ce4322ef5f24ff9cc5e7652d (patch) | |
| tree | b71606b0fcc816dee9b86e84f2c1479224ba30d0 /llvm/cmake/modules | |
| parent | 7cf6f00f56609f1c157311b2ee5eaa23ee62e058 (diff) | |
| download | bcm5719-llvm-fc59812bee11fe53ce4322ef5f24ff9cc5e7652d.tar.gz bcm5719-llvm-fc59812bee11fe53ce4322ef5f24ff9cc5e7652d.zip | |
CMake: make building with /MT an option instead of always forcing it
for release builds.
This is a follow-up to r194589. Aaron pointed out that building
libraries with /MT and using them in an application that uses a
different run-time library can be a bad idea.
Move the option to build with /MT behind a CMake option so it can be
turned on selectively, such as when building the toolchain installer.
llvm-svn: 194596
Diffstat (limited to 'llvm/cmake/modules')
| -rw-r--r-- | llvm/cmake/modules/HandleLLVMOptions.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index ff71c00544f..9fdc708abd7 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -41,13 +41,16 @@ else() endif() endif() -if(MSVC) - # Link release builds against the static runtime. +if(MSVC AND LLVM_STATIC_MSVC_RUNTIME) + # Link 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() + foreach(flag CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG) + llvm_replace_compiler_option("${flag}" "/MDd" "/MTd") + endforeach() endif() if(WIN32) |

