build(cmake): stop defaulting to Debug builds#410
Merged
Conversation
Remove the top-level CMAKE_BUILD_TYPE fallback that forced single-config generators such as Ninja and Makefiles into Debug when users did not pass an explicit build type. This lets CMake preserve its standard empty build-type behavior and requires callers to choose Debug, Release, RelWithDebInfo, or MinSizeRel intentionally.
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the top-level CMAKE_BUILD_TYPE fallback that previously forced single-config generators (e.g., Ninja/Makefiles) into Debug when no build type was specified, restoring CMake’s standard “empty build type unless explicitly set” behavior.
Changes:
- Deleted the root-level logic that set
CMAKE_BUILD_TYPE=Debugwhen unset for single-config generators.
Comments suppressed due to low confidence (1)
CMakeLists.txt:15
- This change makes single-config generators (Ninja/Makefiles) keep the default empty
CMAKE_BUILD_TYPEunless the caller sets one. However, the repo's quick-start docs/examples still show configuring withcmake -S ... -B buildwithout-DCMAKE_BUILD_TYPE=..., which now produces a different build than before (previously forced Debug). To match the PR description (“requires callers to choose … intentionally”) and avoid surprising builds, please update the build instructions (e.g., README + docs/getting-started + examples) to specify a recommended build type (Release/RelWithDebInfo) or explicitly document that leaving it unset is supported and what it implies.
project(simphony VERSION 0.7.0 LANGUAGES CXX CUDA)
# Use CMake's standard testing option, but avoid enabling this project's tests
# by default when Simphony is pulled in as a subproject.
if(NOT DEFINED BUILD_TESTING)
set(BUILD_TESTING ${PROJECT_IS_TOP_LEVEL} CACHE BOOL "Build the testing tree.")
endif()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Remove the top-level CMAKE_BUILD_TYPE fallback that forced single-config generators such as Ninja and Makefiles into Debug when users did not pass an explicit build type.
This lets CMake preserve its standard empty build-type behavior and requires callers to choose Debug, Release, RelWithDebInfo, or MinSizeRel intentionally.