mirror of
https://github.com/ziglang/zig.git
synced 2024-12-12 14:16:59 +00:00
build: add support for ZIG_STATIC on MacOS
This commit is contained in:
parent
cc490f0026
commit
fe524a1fa5
@ -67,6 +67,14 @@ if(NOT MSVC)
|
||||
else()
|
||||
message("${ZLIB} found")
|
||||
endif()
|
||||
|
||||
if(APPLE AND ZIG_STATIC)
|
||||
list(REMOVE_ITEM LLVM_LIBRARIES "-lz")
|
||||
list(REMOVE_ITEM LLVM_LIBRARIES "-lxml2")
|
||||
list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
|
||||
find_library(LIBNCURSES NAMES libncurses.a)
|
||||
list(APPEND LLVM_LIBRARIES "${LIBNCURSES}" "${LIBXML2}" "${ZLIB}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
|
||||
@ -815,7 +823,11 @@ if(MINGW)
|
||||
elseif(MSVC)
|
||||
set(EXE_LDFLAGS "/STACK:16777216")
|
||||
elseif(ZIG_STATIC)
|
||||
set(EXE_LDFLAGS "-static")
|
||||
if(APPLE)
|
||||
set(EXE_LDFLAGS " ")
|
||||
else()
|
||||
set(EXE_LDFLAGS "-static")
|
||||
endif()
|
||||
else()
|
||||
set(EXE_LDFLAGS " ")
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user