build: add CMake presets for the serial/OpenMP/coverage variants - #4
Merged
Conversation
Serial and OpenMP builds are both used routinely, and switching between
them by flipping -DSLIMED_ENABLE_OPENMP on one build directory changes
the -DOMP define for every target, so each flip forced a full rebuild of
all 41 sources.
CMakePresets.json names the three variants and gives each its own build
directory, so both trees persist side by side and switching recompiles
nothing:
cmake --workflow --preset omp # configure + build + test
cmake --workflow --preset serial
cmake --preset omp # or drive the steps separately
cmake --build --preset omp
ctest --preset omp
serial -> build/ (was: make serial / make dyna)
omp -> build-omp/ (was: make omp / make dyna_omp)
coverage -> build-cov/ (was: make test COVERAGE=1)
The presets only set the same -D options documented in the README, so a
CMake older than 3.25 (which is what workflow presets need) can still
configure by hand. .gitignore picks up the new build-*/ directories and
CMakeUserPresets.json, which is machine-local by convention.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Serial and OpenMP builds are both used routinely, and switching between them by flipping -DSLIMED_ENABLE_OPENMP on one build directory changes the -DOMP define for every target, so each flip forced a full rebuild of all 41 sources.
CMakePresets.json names the three variants and gives each its own build directory, so both trees persist side by side and switching recompiles nothing:
serial -> build/ (was: make serial / make dyna)
omp -> build-omp/ (was: make omp / make dyna_omp)
coverage -> build-cov/ (was: make test COVERAGE=1)
The presets only set the same -D options documented in the README, so a CMake older than 3.25 (which is what workflow presets need) can still configure by hand. .gitignore picks up the new build-*/ directories and CMakeUserPresets.json, which is machine-local by convention.