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