Skip to content

Commit

Permalink
[rust] Compile with /MT on MSVC
Browse files Browse the repository at this point in the history
Can't seem to figure out how to do this without this patch...
  • Loading branch information
alexcrichton authored and nikic committed Feb 13, 2024
1 parent 0d656f0 commit fc51bc6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit fc51bc6

Please sign in to comment.