-
-
Notifications
You must be signed in to change notification settings - Fork 325
Split static targets into separate optional target #6109
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
base: develop
Are you sure you want to change the base?
Conversation
|
Looks like we're running into problems with this: picking up the -static files, so I need a different name for it. |
|
Fedora also splits out the java components, so it needs a new target as well. |
|
Hi @opoplawski, at a first glance this seems reasonable and unlikely to be controversial. Out of curiosity, do you happen to have a link to Fedora's packaging guidelines so we can read up on them more regarding this? |
|
Here is a place to start: https://docs.fedoraproject.org/en-US/packaging-guidelines/#packaging-static-libraries |
| endif () | ||
| include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) | ||
| if ( @BUILD_STATIC_LIBS@ ) | ||
| include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@_static-targets.cmake OPTIONAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about best practices, but using OPTIONAL for these seems like it would hide errors in the cases where users were expecting that the static targets file would exist and may be confusing
| if ( @BUILD_STATIC_LIBS@ ) | ||
| include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@_static-targets.cmake OPTIONAL) | ||
| endif () | ||
| if ( @HDF5_BUILD_JAVA@ ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPTIONAL may make sense here however, as HDF5_BUILD_JAVA is checked here, whereas the ..._java-targets.cmake file is created when HDF5_ENABLE_JNI is true rather than HDF5_BUILD_JAVA. I believe that means the ..._java-targets.cmake file won't exist when the Java implementation uses FFM instead of the old JNI, but the FFM source doesn't currently appear to have anything to export as a target anyway.
jhendersonHDF
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, just a couple comments around the use of OPTIONAL when including target files
Fedora packaging guidelines requires that static libraries are shipped in a separate -static sub-package and are not used by other Fedora packages when building. This causes issues with many cmake projects that put both the shared and static targets in the same file, like the following:
We have submitted similar patches to other upstream projects to put the static targets into a separate optional file. This patch is not completely polished - it lacks some symmetry in how names and variables are handled. But I at least wanted to put it out there for comment.
Important
Separate static library targets into optional
-staticCMake files for HDF5 components to comply with Fedora packaging guidelines.-staticCMake files for core, tools, and language bindings.HDF5_STATIC_LIBRARIES_TO_EXPORTvariable to track static libraries.CMakeLists.txtinsrc,tools/lib,c++/src,fortran/src,hl/src,hl/c++/src,hl/fortran/srcto handle static libraries separately.install()commands to export static libraries to-statictargets.hdf5-config.cmake.into include optional static targets.This description was created by
for 846bc8f. You can customize this summary. It will automatically update as commits are pushed.