build: add support for ZIG_STATIC on MacOS

This commit is contained in:
Andrew Kelley 2018-09-27 15:07:51 -04:00
parent cc490f0026
commit fe524a1fa5

View File

@ -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()