authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2025-06-17 13:40:25-06:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-19 13:43:27+02:00
logf5a327cd366348a739a282f380acd627815183b5
treee14e6b23d72b2433c91e6ece8075ad175034c0d1
parent36499c251c592d10a8258b1562bee22e5fb7899a

windows: msvc: avoid linking to non-redistributable ucrt


1 files changed, 10 insertions(+), 0 deletions(-)

CMakeLists.txt+10
......@@ -159,6 +159,16 @@ if(ZIG_STATIC_ZSTD)
159159 list(APPEND LLVM_LIBRARIES "${ZSTD}")
160160endif()
161161
162if (MSVC)
163 if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
164 if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
165 # avoid linking to the debug versions of ucrt by default
166 # as they are not redistributable.
167 set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
168 endif()
169 endif()
170endif ()
171
162172if(ZIG_STATIC_CURSES)
163173 list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
164174 find_library(CURSES NAMES libcurses.a libncurses.a NAMES_PER_DIR