authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-30 16:45:33-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-30 16:56:06-04:00
log418b2e7d47cbfdd8d04c362b758c96b533674282
treef5b5025fa2c9ba3a258240cbfa578f11c9050afe
parent57c4d38c556238530af9b643b4dbc481de417782
signature Commit is signed but in an unrecognized format.

build: omit finding libxml2, zlib since no direct dependency


2 files changed, 5 insertions(+), 25 deletions(-)

CMakeLists.txt+5-24
......@@ -50,31 +50,12 @@ option(ZIG_FORCE_EXTERNAL_LLD "If your system has the LLD patches use it instead
5050find_package(llvm)
5151find_package(clang)
5252
53# TODO fix https://github.com/ziglang/docker-zig/issues/7
54list(REMOVE_ITEM LLVM_LIBRARIES "-l/deps/local/lib/libxml2.a")
55
56if(NOT MSVC)
57 find_library(LIBXML2 NAMES xml2 libxml2)
58 if(${LIBXML2} STREQUAL "LIBXML2-NOTFOUND")
59 message(FATAL_ERROR "Could not find libxml2")
60 else()
61 message("${LIBXML2} found")
62 endif()
63
53if(APPLE AND ZIG_STATIC)
54 list(REMOVE_ITEM LLVM_LIBRARIES "-lz")
55 list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
6456 find_library(ZLIB NAMES z zlib libz)
65 if(${ZLIB} STREQUAL "ZLIB-NOTFOUND")
66 message(FATAL_ERROR "Could not find zlib")
67 else()
68 message("${ZLIB} found")
69 endif()
70
71 if(APPLE AND ZIG_STATIC)
72 list(REMOVE_ITEM LLVM_LIBRARIES "-lz")
73 list(REMOVE_ITEM LLVM_LIBRARIES "-lxml2")
74 list(REMOVE_ITEM LLVM_LIBRARIES "-lcurses")
75 find_library(LIBNCURSES NAMES libncurses.a)
76 list(APPEND LLVM_LIBRARIES "${LIBNCURSES}" "${LIBXML2}" "${ZLIB}")
77 endif()
57 find_library(LIBNCURSES NAMES libncurses.a)
58 list(APPEND LLVM_LIBRARIES "${LIBNCURSES}" "${ZLIB}")
7859endif()
7960
8061set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
README.md-1
......@@ -88,7 +88,6 @@ that counts as "freestanding" for the purposes of this table.
8888 * cmake >= 2.8.5
8989 * gcc >= 5.0.0 or clang >= 3.6.0
9090 * LLVM, Clang, LLD development libraries == 7.x, compiled with the same gcc or clang version above
91 - These depend on zlib and libxml2.
9291
9392##### Windows
9493