summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/connect/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 5695e981413..d985df9eaa7 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -126,6 +126,7 @@ IF(CONNECT_WITH_LIBXML2)
FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
+ SET(ZLIB_LIBRARY "") # see ZLIB_INCLUDE_DIR below
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h)
add_definitions(-DLIBXML2_SUPPORT)
@@ -343,6 +344,14 @@ IF(NOT TARGET connect)
RETURN()
ENDIF()
+# Don't link with bundled zlib and systel libxml2 at the same time.
+# System libxml2 uses system zlib, might conflict with the bundled one.
+IF (XML_LIBRARY AND BUILD_BUNDLED_ZLIB)
+ GET_PROPERTY(INCS TARGET connect PROPERTY INCLUDE_DIRECTORIES)
+ LIST(REMOVE_ITEM INCS ${ZLIB_INCLUDE_DIR})
+ SET_PROPERTY(TARGET connect PROPERTY INCLUDE_DIRECTORIES ${INCS})
+ENDIF()
+
IF(WIN32)
IF (libmongoc-1.0_FOUND)
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS