Advent of Code 2025, done in C++

build: `just run` defaults to release builds for higher runtime speeds

bpavuk.neocities.org b767ccc8 72bcb35f

verified
Changed files
+16 -6
+1
.gitignore
··· 1 1 build/ 2 + build-release/ 2 3 .cache/
+13 -4
Justfile
··· 4 4 5 5 default: sync build 6 6 7 - # Run this whenever you change build files. This generates the latest build config. 7 + # Run this whenever you change build files. This generates the latest build config (debug). 8 8 sync: 9 9 meson setup --reconfigure build/ 10 10 11 + # Release config for running real inputs. 12 + sync-release: 13 + meson setup --reconfigure build-release/ --buildtype=release 14 + 11 15 # Build everything Meson knows about. 12 16 build: 13 17 meson compile -C build/ 14 18 19 + # Build release artifacts. 20 + build-release: sync-release 21 + meson compile -C build-release/ 22 + 15 23 # Run tests for a specific day. Defaults to today's day-of-month. 16 24 test day=default_day: sync 17 25 day=$(printf '%02d' "{{day}}"); meson test -C build "day${day}" 18 26 19 27 # Run a day's solution on the "real" data set. 20 - run day=default_day: sync 21 - day=$(printf '%02d' "{{day}}"); meson compile -C build "run-day${day}" 28 + run day=default_day: sync-release 29 + day=$(printf '%02d' "{{day}}"); meson compile -C build-release "run-day${day}" 22 30 23 31 # Clean the build folder. Useful... sometimes. 24 32 clean: 25 - meson setup --wipe build/ 33 + if [ -d build ]; then meson setup --wipe build/; fi 34 + if [ -d build-release ]; then meson setup --wipe build-release/; fi
+2 -2
README.md
··· 8 8 nix develop # optional if tooling is installed already; brings in clang/meson/just 9 9 just # runs sync + build 10 10 just test 5 # run tests for day 05 11 - just run # run today's solution on "real" data 11 + just run # run today's solution on "real" data (release build) 12 12 ``` 13 13 14 - `just test`/`run` default to today's day-of-month; pass an explicit day to override. Meson owns the build/run logic; Just only wires day selection and delegates. 14 + `just test`/`run` default to today's day-of-month; pass an explicit day to override. `just run` uses a separate Meson release build dir (`build-release`); tests use the debug dir (`build`). Meson owns the build/run logic; Just only wires day selection and delegates. 15 15 16 16 ## Layout 17 17