mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
windows: msvc: avoid linking to non-redistributable ucrt
This commit is contained in:
parent
36499c251c
commit
f5a327cd36
1 changed files with 10 additions and 0 deletions
|
|
@ -159,6 +159,16 @@ if(ZIG_STATIC_ZSTD)
|
||||||
list(APPEND LLVM_LIBRARIES "${ZSTD}")
|
list(APPEND LLVM_LIBRARIES "${ZSTD}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
|
# avoid linking to the debug versions of ucrt by default
|
||||||
|
# as they are not redistributable.
|
||||||
|
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if(ZIG_STATIC_CURSES)
|
if(ZIG_STATIC_CURSES)
|
||||||
list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
|
||||||
find_library(CURSES NAMES libcurses.a libncurses.a NAMES_PER_DIR
|
find_library(CURSES NAMES libcurses.a libncurses.a NAMES_PER_DIR
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue