Commit 411a2540 authored by Sergei Golubchik's avatar Sergei Golubchik

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 c5427172) bundled zlib which causes CONNECT to crash
on xml tests.
parent 3e2394a5
...@@ -126,6 +126,7 @@ IF(CONNECT_WITH_LIBXML2) ...@@ -126,6 +126,7 @@ IF(CONNECT_WITH_LIBXML2)
FIND_PACKAGE(LibXml2) FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND) IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(ZLIB_LIBRARY "") # see ZLIB_INCLUDE_DIR below
SET(XML_LIBRARY ${LIBXML2_LIBRARIES}) SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h) SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h)
add_definitions(-DLIBXML2_SUPPORT) add_definitions(-DLIBXML2_SUPPORT)
...@@ -343,6 +344,14 @@ IF(NOT TARGET connect) ...@@ -343,6 +344,14 @@ IF(NOT TARGET connect)
RETURN() RETURN()
ENDIF() 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(WIN32)
IF (libmongoc-1.0_FOUND) IF (libmongoc-1.0_FOUND)
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment