Commit 418b2e7d47

Andrew Kelley <superjoe30@gmail.com>
2018-09-30 22:45:33
build: omit finding libxml2, zlib since no direct dependency
1 parent 57c4d38
Changed files (2)
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")
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