Skip to content

Commit 01a7d76

Browse files
committed
Build tests and benchmarks only if necessary
1 parent 1e01c07 commit 01a7d76

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pixi.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,21 @@ scripts = ["build_scripts/pixi/activation.sh"]
3333
clean = { cmd = "rm -rf build" }
3434

3535
[tasks.configure]
36-
args = [{ "arg" = "buildtype", "default" = "Release" }]
37-
cmd = "CXXFLAGS=$ALIGATOR_CXX_FLAGS cmake -G Ninja -B build -S . -DCMAKE_BUILD_TYPE={{buildtype}} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTING=ON -DGENERATE_PYTHON_STUBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
36+
args = [{ "arg" = "buildtype", "default" = "Release" }, { "arg" = "buildtests", "default" = "OFF" }, { "arg" = "buildbenchmarks", "default" = "OFF" }]
37+
cmd = "CXXFLAGS=$ALIGATOR_CXX_FLAGS cmake -G Ninja -B build -S . -DCMAKE_BUILD_TYPE={{buildtype}} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTING={{buildtests}} -DBUILD_BENCHMARK={{buildbenchmarks}} -DGENERATE_PYTHON_STUBS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
3838

3939
[tasks.build]
40-
args = [{ "arg" = "buildtype", "default" = "Release" }]
40+
args = [{ "arg" = "buildtype", "default" = "Release" }, { "arg" = "buildtests", "default" = "OFF" }, { "arg" = "buildbenchmarks", "default" = "OFF" }]
4141
cmd = "cmake --build build --target all"
42-
depends-on = [{"task" = "configure", "args" = [{ "buildtype" = "{{buildtype}}" }] }]
42+
depends-on = [{"task" = "configure", "args" = [{"buildtype" = "{{buildtype}}" }, {"buildtests" = "{{buildtests}}" }, {"buildbenchmarks" = "{{buildbenchmarks}}" }] }]
4343

4444
[tasks.test]
4545
cmd = "ctest --test-dir build --output-on-failure"
46-
depends-on = [{"task" = "build", "args" = [{ "buildtype" = "Debug" }] }]
46+
depends-on = [{"task" = "build", "args" = [{ "buildtype" = "Debug" }, {"buildtests" = "ON"}] }]
47+
48+
[tasks.benchmark]
49+
cmd = "ctest --test-dir build --output-on-failure"
50+
depends-on = [{"task" = "build", "args" = [{ "buildtype" = "Release" }, {"buildbenchmarks" = "ON"}] }]
4751

4852
[feature.lint]
4953
dependencies = { pre-commit = ">=3.6.2" }

0 commit comments

Comments
 (0)