aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/HandleLLVMOptions.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/HandleLLVMOptions.cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index ff71c00..9fdc708 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/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)