mirror of
https://github.com/ziglang/zig.git
synced 2024-11-14 16:13:24 +00:00
cmake: allow user to select static vs dynamic LLVM
This commit is contained in:
parent
9dcddc2249
commit
3a67c13b5d
@ -36,6 +36,11 @@ endif()
|
||||
message("Configuring zig version ${ZIG_VERSION}")
|
||||
|
||||
set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not compatible with glibc)")
|
||||
set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")
|
||||
|
||||
if(ZIG_STATIC)
|
||||
set(ZIG_STATIC_LLVM "on")
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_LIB_DIR_ESCAPED "${ZIG_LIBC_LIB_DIR}")
|
||||
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_STATIC_LIB_DIR_ESCAPED "${ZIG_LIBC_STATIC_LIB_DIR}")
|
||||
|
@ -65,7 +65,7 @@ NEED_TARGET("WebAssembly")
|
||||
NEED_TARGET("X86")
|
||||
NEED_TARGET("XCore")
|
||||
|
||||
if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
|
||||
if(ZIG_STATIC_LLVM)
|
||||
execute_process(
|
||||
COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
|
||||
OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
|
||||
|
Loading…
Reference in New Issue
Block a user