Skip to content

Commit

Permalink
Hot-fix for unwanted zlib linkage
Browse files Browse the repository at this point in the history
By removing GCS-detected variables and targets.
  • Loading branch information
ihnorton authored and Shelnutt2 committed Jul 29, 2020
1 parent 0018719 commit 2058d3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/Modules/FindZlib_EP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if (NOT ZLIB_FOUND)
endif()

if (ZLIB_FOUND AND NOT TARGET Zlib::Zlib)
message(STATUS "Found Zlib: ${ZLIB_LIBRARIES}")
message(STATUS "Found Zlib, adding imported target: ${ZLIB_LIBRARIES}")
add_library(Zlib::Zlib UNKNOWN IMPORTED)
set_target_properties(Zlib::Zlib PROPERTIES
IMPORTED_LOCATION "${ZLIB_LIBRARIES}"
Expand Down
14 changes: 13 additions & 1 deletion tiledb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,18 @@ if (TILEDB_GCS)
storage_client
)
add_definitions(-DHAVE_GCS)

# work around for GCS finding the shared version of zlib: we will see the Zlib::Zlib
# transitive linkage later, and we can use the correct version there.
unset(ZLIB_FOUND)
unset(ZLIB_LIBRARIES)
unset(ZLIB_INCLUDE_DIR)

get_target_property(_GCS_INTERFACE_LIBS storage_client INTERFACE_LINK_LIBRARIES)
if ("ZLIB::ZLIB" IN_LIST _GCS_INTERFACE_LIBS)
list(REMOVE_ITEM _GCS_INTERFACE_LIBS "ZLIB::ZLIB")
set_property(TARGET storage_client PROPERTY INTERFACE_LINK_LIBRARIES "${_GCS_INTERFACE_LIBS}")
endif()
endif()

# Libcurl
Expand Down Expand Up @@ -795,4 +807,4 @@ configure_file(
@ONLY
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tiledb.pc
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig)
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig)

0 comments on commit 2058d3d

Please sign in to comment.