build: omit finding libxml2, zlib since no direct dependency
parent
57c4d38c55
commit
418b2e7d47
|
@ -50,31 +50,12 @@ option(ZIG_FORCE_EXTERNAL_LLD "If your system has the LLD patches use it instead
|
||||||
find_package(llvm)
|
find_package(llvm)
|
||||||
find_package(clang)
|
find_package(clang)
|
||||||
|
|
||||||
# TODO fix https://github.com/ziglang/docker-zig/issues/7
|
if(APPLE AND ZIG_STATIC)
|
||||||
list(REMOVE_ITEM LLVM_LIBRARIES "-l/deps/local/lib/libxml2.a")
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lz")
|
||||||
|
list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
|
||||||
if(NOT MSVC)
|
|
||||||
find_library(LIBXML2 NAMES xml2 libxml2)
|
|
||||||
if(${LIBXML2} STREQUAL "LIBXML2-NOTFOUND")
|
|
||||||
message(FATAL_ERROR "Could not find libxml2")
|
|
||||||
else()
|
|
||||||
message("${LIBXML2} found")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_library(ZLIB NAMES z zlib libz)
|
find_library(ZLIB NAMES z zlib libz)
|
||||||
if(${ZLIB} STREQUAL "ZLIB-NOTFOUND")
|
find_library(LIBNCURSES NAMES libncurses.a)
|
||||||
message(FATAL_ERROR "Could not find zlib")
|
list(APPEND LLVM_LIBRARIES "${LIBNCURSES}" "${ZLIB}")
|
||||||
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()
|
endif()
|
||||||
|
|
||||||
set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
|
set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
|
||||||
|
|
|
@ -88,7 +88,6 @@ that counts as "freestanding" for the purposes of this table.
|
||||||
* cmake >= 2.8.5
|
* cmake >= 2.8.5
|
||||||
* gcc >= 5.0.0 or clang >= 3.6.0
|
* gcc >= 5.0.0 or clang >= 3.6.0
|
||||||
* LLVM, Clang, LLD development libraries == 7.x, compiled with the same gcc or clang version above
|
* LLVM, Clang, LLD development libraries == 7.x, compiled with the same gcc or clang version above
|
||||||
- These depend on zlib and libxml2.
|
|
||||||
|
|
||||||
##### Windows
|
##### Windows
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue