From 418b2e7d47cbfdd8d04c362b758c96b533674282 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 30 Sep 2018 16:45:33 -0400 Subject: [PATCH] build: omit finding libxml2, zlib since no direct dependency --- CMakeLists.txt | 29 +++++------------------------ README.md | 1 - 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e99f2ea34..98b2ab9db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/README.md b/README.md index d3a64abba..69c52e200 100644 --- a/README.md +++ b/README.md @@ -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