Skip to content

Commit

Permalink
Apply CMake's STATIC_LINK option to MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
animetosho committed Apr 19, 2024
1 parent bbb2135 commit 6c35003
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ if (${TARGET_ARCH} MATCHES "riscv32|rv32")
endif()

if(STATIC_LINK)
add_link_options(-static)
if(MSVC)
add_compile_options("$<$<NOT:$<CONFIG:Debug>>:/MT>$<$<CONFIG:Debug>:/MTd>")
else()
add_link_options(-static)
endif()
endif()

if(MSVC)
Expand Down

0 comments on commit 6c35003

Please sign in to comment.