build: omit finding libxml2, zlib since no direct dependency

master
Andrew Kelley 2018-09-30 16:45:33 -04:00
parent 57c4d38c55
commit 418b2e7d47
No known key found for this signature in database
GPG Key ID: 4E7CD66038A4D47C
2 changed files with 5 additions and 25 deletions

View File

@ -50,31 +50,12 @@ option(ZIG_FORCE_EXTERNAL_LLD "If your system has the LLD patches use it instead
find_package(llvm)
find_package(clang)
# TODO fix https://github.com/ziglang/docker-zig/issues/7
list(REMOVE_ITEM LLVM_LIBRARIES "-l/deps/local/lib/libxml2.a")
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()
if(APPLE AND ZIG_STATIC)
list(REMOVE_ITEM LLVM_LIBRARIES "-lz")
list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
find_library(ZLIB NAMES z zlib libz)
if(${ZLIB} STREQUAL "ZLIB-NOTFOUND")
message(FATAL_ERROR "Could not find 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()
find_library(LIBNCURSES NAMES libncurses.a)
list(APPEND LLVM_LIBRARIES "${LIBNCURSES}" "${ZLIB}")
endif()
set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")

View File

@ -88,7 +88,6 @@ that counts as "freestanding" for the purposes of this table.
* cmake >= 2.8.5
* 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
- These depend on zlib and libxml2.
##### Windows