Skip to content

build: add CMake presets for the serial/OpenMP/coverage variants - #4

Merged
yingyue2030699 merged 1 commit into
mainfrom
cmake-presets
Aug 19, 2026
Merged

build: add CMake presets for the serial/OpenMP/coverage variants#4
yingyue2030699 merged 1 commit into
mainfrom
cmake-presets

Conversation

@yingyue2030699

Copy link
Copy Markdown
Member

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.

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>
@yingyue2030699
yingyue2030699 merged commit 36625f1 into main Aug 19, 2026
3 checks passed
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yingyue2030699
yingyue2030699 deleted the cmake-presets branch August 28, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant