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
Set default build type to DebugRelease #5202
Conversation
# | ||
# Setup CMAKE_BUILD_TYPE: | ||
# | ||
|
||
SET(CMAKE_BUILD_TYPE | ||
"DebugRelease" | ||
CACHE STRING | ||
"Choose the type of build, options are: Debug, Release and DebugRelease." | ||
) |
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 a variable in the cmake namespace. Isn't it defined by default?
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.
It is, but the default documentation says that only 'Debug' and 'Release' are allowed options. This way I overwrite the documentation with the additional option. I copied this code from https://github.com/dealii/dealii/blob/master/cmake/setup_cached_variables.cmake do you want me to make the same change there too?
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 see. I trust @tamiko that it is ok to overwrite this variable.
And yes, it would of course be fantastic if you could make the same changes there as well!
CMakeLists.txt
Outdated
NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND | ||
NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease" ) | ||
MESSAGE(FATAL_ERROR | ||
"CMAKE_BUILD_TYPE does neither match Release, Debug, nor DebugRelease!" |
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.
"CMAKE_BUILD_TYPE does neither match Release, Debug, nor DebugRelease!" | |
"CMAKE_BUILD_TYPE must either be 'Release', 'Debug', nor 'DebugRelease', but is set to '${CMAKE_BUILD_TYPE}'." |
(Rene Gassmoeller, Timo Heister, 2023/07/07) | ||
|
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.
(Rene Gassmoeller, Timo Heister, 2023/07/07) | |
(Rene Gassmoeller, Timo Heister, 2023/07/07) |
73f0aa0
to
1244d4f
Compare
I included the suggestions. |
Thank you. I agree and made the change on my machine since I introduced it. |
This sets the ASPECT default build type to DebugRelease (just like deal.II). This creates two executables in the build directory. The main reason I think this is more useful because most users will need both executables eventually (debug for testing, release for actually running models) and I keep encountering users that either:
I hope with this change we can reduce these confusions (at the cost of slower compile time).