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 Dec 20, 2022
1 parent 9a83a54 commit df025f8
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 @@ -200,6 +200,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 df025f8

Please sign in to comment.