mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
cmake: support static linking against libxml2
This commit is contained in:
parent
5be3c7874c
commit
dc090e99cf
1 changed files with 7 additions and 0 deletions
|
|
@ -90,6 +90,7 @@ set(ZIG_STATIC_LLVM ${ZIG_STATIC} CACHE BOOL "Prefer linking against static LLVM
|
||||||
set(ZIG_STATIC_ZLIB ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zlib")
|
set(ZIG_STATIC_ZLIB ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zlib")
|
||||||
set(ZIG_STATIC_ZSTD ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zstd")
|
set(ZIG_STATIC_ZSTD ${ZIG_STATIC} CACHE BOOL "Prefer linking against static zstd")
|
||||||
set(ZIG_STATIC_CURSES OFF CACHE BOOL "Enable static linking against curses")
|
set(ZIG_STATIC_CURSES OFF CACHE BOOL "Enable static linking against curses")
|
||||||
|
set(ZIG_STATIC_LIBXML2 OFF CACHE BOOL "Enable static linking against libxml2")
|
||||||
|
|
||||||
if (ZIG_SHARED_LLVM AND ZIG_STATIC_LLVM)
|
if (ZIG_SHARED_LLVM AND ZIG_STATIC_LLVM)
|
||||||
message(SEND_ERROR "-DZIG_SHARED_LLVM and -DZIG_STATIC_LLVM cannot both be enabled simultaneously")
|
message(SEND_ERROR "-DZIG_SHARED_LLVM and -DZIG_STATIC_LLVM cannot both be enabled simultaneously")
|
||||||
|
|
@ -167,6 +168,12 @@ if(ZIG_STATIC_CURSES)
|
||||||
list(APPEND LLVM_LIBRARIES "${CURSES}")
|
list(APPEND LLVM_LIBRARIES "${CURSES}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ZIG_STATIC_LIBXML2)
|
||||||
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lxml2")
|
||||||
|
find_library(LIBXML2 NAMES libxml2.a NAMES_PER_DIR)
|
||||||
|
list(APPEND LLVM_LIBRARIES "${LIBXML2}")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
||||||
set(ZIG_CONFIG_H_OUT "${PROJECT_BINARY_DIR}/config.h")
|
set(ZIG_CONFIG_H_OUT "${PROJECT_BINARY_DIR}/config.h")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue