From fc51bc664820a072e620511a671a94133ec2ac32 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 10 Feb 2018 17:21:38 -0800 Subject: [PATCH] [rust] Compile with /MT on MSVC Can't seem to figure out how to do this without this patch... --- lld/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt index 595c286abd91a6..d17d3c55395aa5 100644 --- a/lld/CMakeLists.txt +++ b/lld/CMakeLists.txt @@ -187,6 +187,19 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) ) endif() +if (MSVC) + FOREACH(flag + CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT + CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) + if (MSVC) + STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + SET("${flag}" "${${flag}}") + endif (MSVC) + ENDFOREACH() +endif() + add_subdirectory(Common) add_subdirectory(tools/lld)