From 2c9cf2a520ca704e40f51756497f3bd833d45359 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Feb 2017 01:48:24 -0800 Subject: [PATCH] [hdf5] Mark linked libraries as private --- ports/hdf5/CONTROL | 2 +- ports/hdf5/link-libraries-private.patch | 29 +++++++++++++++++++++++++ ports/hdf5/portfile.cmake | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ports/hdf5/link-libraries-private.patch diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL index b2364c378..70d1f9979 100644 --- a/ports/hdf5/CONTROL +++ b/ports/hdf5/CONTROL @@ -1,4 +1,4 @@ Source: hdf5 -Version: 1.10.0-patch1 +Version: 1.10.0-patch1-1 Description: HDF5 is a data model, library, and file format for storing and managing data Build-Depends: zlib, szip, msmpi \ No newline at end of file diff --git a/ports/hdf5/link-libraries-private.patch b/ports/hdf5/link-libraries-private.patch new file mode 100644 index 000000000..15db78a2d --- /dev/null +++ b/ports/hdf5/link-libraries-private.patch @@ -0,0 +1,29 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index a63cc3a..aea963d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -900,12 +900,12 @@ if (BUILD_SHARED_LIBS) + set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) + add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") +- target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_SHARED_LIBS}) + if (NOT WIN32) +- target_link_libraries (${HDF5_LIBSH_TARGET} dl) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE dl) + endif (NOT WIN32) + if (H5_HAVE_PARALLEL AND MPI_C_FOUND) +- target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES}) + endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) + set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") + H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) +@@ -920,7 +920,7 @@ if (BUILD_SHARED_LIBS) + APPEND PROPERTY COMPILE_DEFINITIONS + "H5_HAVE_THREADSAFE" + ) +- target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) ++ target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE Threads::Threads) + endif (HDF5_ENABLE_THREADSAFE) + + if (HDF5_ENABLE_DEBUG_APIS) diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index 6eb8a6b28..b2d32a322 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -27,6 +27,7 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/use-szip-config.patch ${CMAKE_CURRENT_LIST_DIR}/disable-static-libs.patch + ${CMAKE_CURRENT_LIST_DIR}/link-libraries-private.patch ) set(DISABLE_STATIC_LIBS OFF)