aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-03-20 16:05:15 -0400
committerGitHub <noreply@github.com>2018-03-20 16:05:15 -0400
commit1369fecccfcd7900ce0a78a67db96ed59957720a (patch)
tree2b8a1557d95cf22877621c5530da0c939bcdb59b
parentcb744f3a28cf5aa6caef797e9265b7165c903a55 (diff)
parent543952eb87f7b06a41dd001273a59a0dea728c39 (diff)
downloadzig-1369fecccfcd7900ce0a78a67db96ed59957720a.tar.gz
zig-1369fecccfcd7900ce0a78a67db96ed59957720a.zip
Merge pull request #847 from walac/master
Include libxml2 and zlib as required libraries
-rw-r--r--CMakeLists.txt18
1 files changed, 17 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a4f571719..979d771cda 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,22 @@ option(ZIG_FORCE_EXTERNAL_LLD "If your system has the LLD patches use it instead
find_package(llvm)
find_package(clang)
+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()
+
+ find_library(ZLIB NAMES z zlib libz)
+ if(${ZLIB} STREQUAL "ZLIB-NOTFOUND")
+ message(FATAL_ERROR "Could not find zlib")
+ else()
+ message("${ZLIB} found")
+ endif()
+endif()
+
set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
if(ZIG_FORCE_EXTERNAL_LLD)
@@ -710,7 +726,7 @@ target_link_libraries(zig LINK_PUBLIC
${CMAKE_THREAD_LIBS_INIT}
)
if(NOT MSVC)
- target_link_libraries(zig LINK_PUBLIC xml2)
+ target_link_libraries(zig LINK_PUBLIC ${LIBXML2})
endif()
if(ZIG_DIA_GUIDS_LIB)
target_link_libraries(zig LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})