summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-10-28 10:09:58 +0100
committerSergei Golubchik <serg@mariadb.org>2018-10-28 10:09:58 +0100
commit411a2540ee043a6805555387df1b26b48b483eef (patch)
tree8182c6fe9515422090a19a0450e1abbd18591f52 /storage
parent3e2394a56b2c624fdd01723bf5c7f47fbbb853ec (diff)
downloadmariadb-git-411a2540ee043a6805555387df1b26b48b483eef.tar.gz
CONNECT: don't mix bundled zlib and system libxml2
System libxml2 uses system zlib, it might conflicts with the bundled. In particular, on centos5 old system zlib conflicts with the newer (after c54271723c6f) bundled zlib which causes CONNECT to crash on xml tests.
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