authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-03-20 16:05:15-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2018-03-20 16:05:15-04:00
log1369fecccfcd7900ce0a78a67db96ed59957720a
tree2b8a1557d95cf22877621c5530da0c939bcdb59b
parentcb744f3a28cf5aa6caef797e9265b7165c903a55
parent543952eb87f7b06a41dd001273a59a0dea728c39
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #847 from walac/master

Include libxml2 and zlib as required libraries

1 files changed, 17 insertions(+), 1 deletions(-)

CMakeLists.txt+17-1
...@@ -49,6 +49,22 @@ option(ZIG_FORCE_EXTERNAL_LLD "If your system has the LLD patches use it instead...@@ -49,6 +49,22 @@ option(ZIG_FORCE_EXTERNAL_LLD "If your system has the LLD patches use it instead
49find_package(llvm)49find_package(llvm)
50find_package(clang)50find_package(clang)
5151
52if(NOT MSVC)
53 find_library(LIBXML2 NAMES xml2 libxml2)
54 if(${LIBXML2} STREQUAL "LIBXML2-NOTFOUND")
55 message(FATAL_ERROR "Could not find libxml2")
56 else()
57 message("${LIBXML2} found")
58 endif()
59
60 find_library(ZLIB NAMES z zlib libz)
61 if(${ZLIB} STREQUAL "ZLIB-NOTFOUND")
62 message(FATAL_ERROR "Could not find zlib")
63 else()
64 message("${ZLIB} found")
65 endif()
66endif()
67
52set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")68set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
5369
54if(ZIG_FORCE_EXTERNAL_LLD)70if(ZIG_FORCE_EXTERNAL_LLD)
...@@ -710,7 +726,7 @@ target_link_libraries(zig LINK_PUBLIC...@@ -710,7 +726,7 @@ target_link_libraries(zig LINK_PUBLIC
710 ${CMAKE_THREAD_LIBS_INIT}726 ${CMAKE_THREAD_LIBS_INIT}
711)727)
712if(NOT MSVC)728if(NOT MSVC)
713 target_link_libraries(zig LINK_PUBLIC xml2)729 target_link_libraries(zig LINK_PUBLIC ${LIBXML2})
714endif()730endif()
715if(ZIG_DIA_GUIDS_LIB)731if(ZIG_DIA_GUIDS_LIB)
716 target_link_libraries(zig LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})732 target_link_libraries(zig LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})