-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[szip, hdf5] Fix mingw import lib names, control linkage #17941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
be32313
Format manifest, make port version explicit
dg0yt 60c81f4
Use standard mingw import lib names
dg0yt c70d925
Choose either static or shared binaries
dg0yt 7f82566
Insert macro for dynamic linkage
dg0yt 0f8614f
Add szip pc file
dg0yt 8b6161e
Quote path expressions
dg0yt e6a39f9
Port away from deprecated cmake functions
dg0yt 39dc96e
x-add-version
dg0yt 1feab38
Begin of hdf5 changes
dg0yt 2e18eda
Remove obsolete variables (complements 23eadeae)
dg0yt 23a8053
Fix indentation and quoting expressions
dg0yt f5e049d
Handle single-linkage szip configuration
dg0yt df5e5c2
Use mingw import lib names for hdf5
dg0yt d55c227
Move dependencies to Requires in pc file
dg0yt 1801a51
Port away from deprecated cmake functions
dg0yt 6d0b01f
x-add-version hdf5
dg0yt 42aab96
Apply szip review comments
dg0yt 4a351f4
Update version
dg0yt 8743971
Improve pkgconfig patch to handle lists
dg0yt 690cb2d
Update git-tree
dg0yt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| diff -urw a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake | ||
| --- a/config/cmake_ext_mod/HDFMacros.cmake 2020-03-03 00:03:12.000000000 +0100 | ||
| +++ b/config/cmake_ext_mod/HDFMacros.cmake 2021-05-12 07:56:13.703041807 +0200 | ||
| @@ -144,7 +144,7 @@ | ||
| endif () | ||
|
|
||
| #----- Use MSVC Naming conventions for Shared Libraries | ||
| - if (MINGW AND ${libtype} MATCHES "SHARED") | ||
| + if (FALSE AND MINGW AND ${libtype} MATCHES "SHARED") | ||
| set_target_properties (${libtarget} PROPERTIES | ||
| IMPORT_SUFFIX ".lib" | ||
| IMPORT_PREFIX "" | ||
| @@ -168,7 +168,7 @@ | ||
|
|
||
| if (${libtype} MATCHES "SHARED") | ||
| if (WIN32) | ||
| - if (MINGW) | ||
| + if (FALSE AND MINGW) | ||
| set_target_properties (${libtarget} PROPERTIES | ||
| IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib" | ||
| IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" | ||
| @@ -180,7 +180,7 @@ | ||
| ) | ||
| endif () | ||
| else () | ||
| - if (MINGW) | ||
| + if (FALSE AND MINGW) | ||
| set_target_properties (${libtarget} PROPERTIES | ||
| IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib" | ||
| IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| diff -urN a/CMakeLists.txt b/CMakeLists.txt | ||
| --- a/CMakeLists.txt 2020-03-03 00:03:12.000000000 +0100 | ||
| +++ b/CMakeLists.txt 2021-05-15 15:02:03.496210691 +0200 | ||
| @@ -682,6 +682,9 @@ | ||
| if (MPI_C_LINK_FLAGS) | ||
| set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") | ||
| endif () | ||
| + if(UNIX) | ||
| + set(ompi-c_PC_LIBS_PRIVATE ${MPI_C_LIBRARIES}) | ||
| + endif() | ||
| endif () | ||
|
|
||
| #option (DEFAULT_API_VERSION "Enable v1.12 API (v16, v18, v110, v112)" "v112") | ||
| diff -urN a/CMakeFilters.cmake b/CMakeFilters.cmake | ||
| --- a/CMakeFilters.cmake 2020-03-03 00:03:12.000000000 +0100 | ||
| +++ b/CMakeFilters.cmake 2021-05-15 12:35:58.453641554 +0200 | ||
| @@ -55,6 +55,7 @@ | ||
| if (ZLIB_FOUND) | ||
| set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) | ||
| set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) | ||
| + set (zlib_PC_LIBS_PRIVATE "${ZLIB_LIBRARIES}") | ||
| endif () | ||
| endif () | ||
| endif () | ||
| @@ -130,6 +131,7 @@ | ||
| set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) | ||
| endif () | ||
| set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) | ||
| + set (szip_PC_LIBS_PRIVATE "${SZIP_STATIC_LIBRARY}") | ||
| INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) | ||
| message (STATUS "Filter SZIP is ON") | ||
| if (H5_HAVE_FILTER_SZIP) | ||
| diff -urN a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| --- a/src/CMakeLists.txt 2020-03-03 00:03:12.000000000 +0100 | ||
| +++ b/src/CMakeLists.txt 2021-05-15 12:41:34.762354040 +0200 | ||
| @@ -1259,6 +1259,15 @@ | ||
|
|
||
| set (_PKG_CONFIG_REQUIRES) | ||
| set (_PKG_CONFIG_REQUIRES_PRIVATE) | ||
| +set(_PKG_CONFIG_LIBS_PRIVATE " ${_PKG_CONFIG_LIBS_PRIVATE} ") | ||
| +foreach(_module IN ITEMS ompi-c szip zlib) | ||
| + if(${_module}_PC_LIBS_PRIVATE) | ||
| + foreach(_lib IN LISTS ${_module}_PC_LIBS_PRIVATE) | ||
| + string(REPLACE " -l${_lib} " " " _PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE}") | ||
| + endforeach() | ||
| + string(APPEND _PKG_CONFIG_REQUIRES_PRIVATE " ${_module}") | ||
| + endif() | ||
| +endforeach() | ||
|
|
||
| configure_file ( | ||
| ${HDF_RESOURCES_DIR}/libhdf5.pc.in | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
| diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake | ||
| index 5a8956456..997bb8e81 100644 | ||
| --- a/CMakeFilters.cmake | ||
| +++ b/CMakeFilters.cmake | ||
| @@ -100,7 +100,7 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) | ||
| if (HDF5_ENABLE_SZIP_SUPPORT) | ||
| option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) | ||
| if (NOT SZIP_USE_EXTERNAL) | ||
| - find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) | ||
| + find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}) | ||
| diff -urN a/CMakeFilters.cmake b/CMakeFilters.cmake | ||
| --- a/CMakeFilters.cmake 2021-05-15 19:07:48.160044927 +0200 | ||
| +++ b/CMakeFilters.cmake 2021-05-15 19:22:56.993970332 +0200 | ||
| @@ -104,7 +104,11 @@ | ||
| find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) | ||
| if (NOT SZIP_FOUND) | ||
| find_package (SZIP) # Legacy find | ||
| if (SZIP_FOUND) | ||
| - if (SZIP_FOUND) | ||
| + if (DEFINED SZIP_SHARED_LIBRARY AND NOT DEFINED SZIP_STATIC_LIBRARY) | ||
| + set (SZIP_STATIC_LIBRARY "${SZIP_SHARED_LIBRARY}") | ||
| + elseif (DEFINED SZIP_STATIC_LIBRARY AND NOT DEFINED SZIP_SHARED_LIBRARY) | ||
| + set (SZIP_SHARED_LIBRARY "${SZIP_STATIC_LIBRARY}") | ||
| + elseif (SZIP_FOUND) | ||
| set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) | ||
| set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) | ||
| endif () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| diff -urN a/config/cmake/szip-config.cmake.in b/config/cmake/szip-config.cmake.in | ||
| --- a/config/cmake/szip-config.cmake.in 2017-01-09 16:14:35.000000000 +0100 | ||
| +++ b/config/cmake/szip-config.cmake.in 2021-05-14 21:26:09.490134839 +0200 | ||
| @@ -39,8 +39,13 @@ | ||
|
|
||
| # Handle default component(static) : | ||
| if (NOT ${SZIP_PACKAGE_NAME}_FIND_COMPONENTS) | ||
| + if(@BUILD_SHARED_LIBS@) | ||
| + set (${SZIP_PACKAGE_NAME}_FIND_COMPONENTS shared) | ||
| + set (${SZIP_PACKAGE_NAME}_FIND_REQUIRED_shared true) | ||
| + else() | ||
| set (${SZIP_PACKAGE_NAME}_FIND_COMPONENTS static) | ||
| set (${SZIP_PACKAGE_NAME}_FIND_REQUIRED_static true) | ||
| + endif() | ||
| endif () | ||
|
|
||
| # Handle requested components: | ||
| diff -urN a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| --- a/src/CMakeLists.txt 2017-02-03 20:42:43.000000000 +0100 | ||
| +++ b/src/CMakeLists.txt 2021-05-14 22:20:28.237632925 +0200 | ||
| @@ -22,6 +22,7 @@ | ||
| ${SZIP_SRC_SOURCE_DIR}/szlib.h | ||
| ) | ||
|
|
||
| +if(NOT BUILD_SHARED_LIBS) | ||
| add_library (${SZIP_LIB_TARGET} STATIC ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) | ||
| #set_target_properties (${SZIP_LIB_TARGET} | ||
| # PROPERTIES | ||
| @@ -36,6 +37,7 @@ | ||
| set_global_variable (SZIP_LIBRARIES_TO_EXPORT ${SZIP_LIB_TARGET}) | ||
| SZIP_SET_LIB_OPTIONS (${SZIP_LIB_TARGET} ${SZIP_LIB_NAME} STATIC) | ||
| set (install_targets ${SZIP_LIB_TARGET}) | ||
| +endif(NOT BUILD_SHARED_LIBS) | ||
|
|
||
| if (BUILD_SHARED_LIBS) | ||
| add_library (${SZIP_LIBSH_TARGET} SHARED ${SZIP_SRCS} ${SZIP_PUBLIC_HEADERS}) | ||
| @@ -62,8 +64,9 @@ | ||
| if (SZIP_EXPORTED_TARGETS) | ||
| if (BUILD_SHARED_LIBS) | ||
| INSTALL_TARGET_PDB (${SZIP_LIBSH_TARGET} ${SZIP_INSTALL_BIN_DIR} libraries) | ||
| - endif (BUILD_SHARED_LIBS) | ||
| + else() | ||
| INSTALL_TARGET_PDB (${SZIP_LIB_TARGET} ${SZIP_INSTALL_BIN_DIR} libraries) | ||
| + endif() | ||
|
|
||
| install ( | ||
| TARGETS |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| diff -urN a/config/cmake/SZIPMacros.cmake b/config/cmake/SZIPMacros.cmake | ||
| --- a/config/cmake/SZIPMacros.cmake 2021-05-15 09:06:50.546455249 +0200 | ||
| +++ b/config/cmake/SZIPMacros.cmake 2021-05-15 09:01:24.933765423 +0200 | ||
| @@ -126,7 +126,7 @@ | ||
| macro (SZIP_SET_BASE_OPTIONS libtarget libname libtype) | ||
| # message (STATUS "${libname} libtype: ${libtype}") | ||
| if (${libtype} MATCHES "SHARED") | ||
| - if (WIN32) | ||
| + if (WIN32 AND NOT MINGW) | ||
| set (LIB_RELEASE_NAME "${libname}") | ||
| set (LIB_DEBUG_NAME "${libname}_D") | ||
| else () | ||
| @@ -134,7 +134,7 @@ | ||
| set (LIB_DEBUG_NAME "${libname}_debug") | ||
| endif () | ||
| else () | ||
| - if (WIN32) | ||
| + if (WIN32 AND NOT MINGW) | ||
| set (LIB_RELEASE_NAME "lib${libname}") | ||
| set (LIB_DEBUG_NAME "lib${libname}_D") | ||
| else () | ||
| @@ -164,7 +164,7 @@ | ||
| endif () | ||
|
|
||
| #----- Use MSVC Naming conventions for Shared Libraries | ||
| - if (MINGW AND ${libtype} MATCHES "SHARED") | ||
| + if (FALSE AND MINGW AND ${libtype} MATCHES "SHARED") | ||
| set_target_properties (${libtarget} | ||
| PROPERTIES | ||
| IMPORT_SUFFIX ".lib" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.