Skip to content

Commit

Permalink
[build] Fixup CMake presets a bit
Browse files Browse the repository at this point in the history
Improves naming, and uses an inherit for examples + sccache

Signed-off-by: Jade Turner <[email protected]>
  • Loading branch information
spacey-sooty committed Oct 3, 2024
1 parent 97f6b77 commit c376eaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trajoptlib-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
# sccache doesn't work with MSBuild
if: ${{ !startsWith(matrix.os, 'windows') }}

- run: cmake --preset with-examples-sccache ${{ matrix.cmake-args }}
- run: cmake --preset with-examples-and-sccache ${{ matrix.cmake-args }}
if: ${{ !startsWith(matrix.os, 'windows') }}
working-directory: trajoptlib
- run: cmake -B build -S . -DBUILD_EXAMPLES=ON ${{ matrix.cmake-args }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trajoptlib-sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up sccache
uses: mozilla-actions/[email protected]

- run: cmake --preset with-examples-sccache ${{ matrix.cmake-args }}
- run: cmake --preset with-examples-and-sccache ${{ matrix.cmake-args }}
working-directory: trajoptlib
- run: cmake --build build --config RelWithDebInfo --parallel $(nproc)
working-directory: trajoptlib
Expand Down
7 changes: 3 additions & 4 deletions trajoptlib/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cacheVariables": {}
},
{
"name": "sccache",
"name": "with-sccache",
"displayName": "",
"description": "Ninja config with sccache",
"generator": "Ninja",
Expand All @@ -36,14 +36,13 @@
}
},
{
"name": "with-examples-sccache",
"name": "with-examples-and-sccache",
"displayName": "",
"description": "Ninja config with sccache",
"generator": "Ninja",
"binaryDir": "build",
"inherits": "with-sccache",
"cacheVariables": {
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"BUILD_EXAMPLES": "ON"
}
}
Expand Down

0 comments on commit c376eaf

Please sign in to comment.