-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Closed
derobins
wants to merge
5
commits into
HDFGroup:develop
from
derobins:add_cmake_build_mode_flags_libsettings
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
60d538d
Add CMake build mode flags to libhdf5.settings
derobins 5e2f05e
Add Fortran and C++ CMake build mode flags to libhdf5.settings
derobins f847454
Remove blank line
derobins c84f974
Improve comment
derobins 01a3dfd
Improve comment
derobins 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 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 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 |
---|---|---|
|
@@ -465,3 +465,33 @@ if (HDF5_ENABLE_OPTIMIZATION) | |
list (APPEND HDF5_CMAKE_C_FLAGS "${OPTIMIZE_CFLAGS}") | ||
endif () | ||
MARK_AS_ADVANCED (HDF5_ENABLE_OPTIMIZATION) | ||
|
||
#----------------------------------------------------------------------------- | ||
# The build mode flags are not added to CMAKE_C_FLAGS, so create a separate | ||
# variable for them so they can be written out to libhdf5.settings and | ||
# 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I can do that |
||
set (HDF5_BUILD_MODE_CXX_FLAGS "") | ||
if ("${HDF_CFG_NAME}" STREQUAL "Debug") | ||
set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_DEBUG}") | ||
set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_DEBUG}") | ||
set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") | ||
elseif ("${HDF_CFG_NAME}" STREQUAL "Developer") | ||
set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_DEVELOPER}") | ||
set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_DEBUG}") | ||
set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") | ||
elseif ("${HDF_CFG_NAME}" STREQUAL "Release") | ||
set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE}") | ||
set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_RELEASE}") | ||
set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}") | ||
elseif ("${HDF_CFG_NAME}" STREQUAL "MinSizeRel") | ||
set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_MINSIZEREL}") | ||
set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_MINSIZEREL}") | ||
set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_MINSIZEREL}") | ||
elseif ("${HDF_CFG_NAME}" STREQUAL "RelWithDebInfo") | ||
set (HDF5_BUILD_MODE_C_FLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") | ||
set (HDF5_BUILD_MODE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO}") | ||
set (HDF5_BUILD_MODE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") | ||
endif () |
This file contains 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 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 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
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.
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.