-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add CMake build mode flags to hdf5lib.settings #4816
Add CMake build mode flags to hdf5lib.settings #4816
Conversation
The build mode flags for things like optimization are not added to CMAKE_C_FLAGS and were not exported to the libhdf5.settings file. This change corrects that. Also removes -Og from the developer mode flags since that's already set via the debug flags the developer mode is based on.
# that collect debugging information | ||
set (CMAKE_C_FLAGS_DEVELOPER "${CMAKE_C_FLAGS_DEBUG} -Og" CACHE STRING | ||
# Set CMake C flags based off of Debug build flags | ||
set (CMAKE_C_FLAGS_DEVELOPER "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING |
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.
This is already set in the debug flags
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.
This is CMAKE_C_FLAGS_DEBUG
, which will only capture the debug flags that are added by default by CMake, or explicitly added at configure time by the user. Not the flags that we add separately in the library's configuration.
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.
That said, some compilers don't have -Og
, so this does need to be refactored at some point, but I still find it useful.
# H5build_settings.c | ||
#----------------------------------------------------------------------------- | ||
set (HDF5_BUILD_MODE_C_FLAGS "") | ||
set (HDF5_BUILD_MODE_Fortran_FLAGS "") |
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.
Shouldn't the Fortran and CXX flags be set in the HDFFortranCompilerFlags.cmake and HDFCXXCompilerFlags.cmake files?
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.
I can do that
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.
Move CXX/Fortran flag setting to correct cmake files
* Split CMake HDFCompileFlags into specific compiler files * Separate out CXX Flags * Add Fortran compiler specific files * Merge in HDFGroup#4816 changes and close HDFGroup#4816 * fix hanging endif --------- Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
* Split CMake HDFCompileFlags into specific compiler files * Separate out CXX Flags * Add Fortran compiler specific files * Merge in HDFGroup#4816 changes and close HDFGroup#4816 * fix hanging endif --------- Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Flags from the CMake build mode (e.g., optimization) are not a part of
CMAKE__FLAGS and were not exported to the libhdf5.settings file. This
has been fixed and the C, Fortran, and C++ build mode flags are now exported to
the file.
This also affects the text output of H5check_version() and the libhdf5.settings
string stored in the library (for those who use strings(1), etc. to get
build info from the binary).