Files
cpp-template/Justfile
Shrukan db47fe1433
Some checks failed
Build and Test Code / test (push) Successful in 3m39s
Build and Test Code / static_analysis (push) Successful in 3m43s
Build and Test Code / coverage (push) Successful in 3m51s
Build and Test Code / sanitize (push) Successful in 3m37s
Build Docs / build-docs (push) Successful in 3m3s
Build Image / build-dev-image (push) Failing after 2m40s
fix: bump versions in dockerfile, fix pre-commit
2025-09-28 09:24:49 -06:00

74 lines
1.8 KiB
Makefile

# Default build prefix and type
BUILD_PREFIX := "./build"
BUILD_TYPE := "release"
set positional-arguments
# List all available targets
default:
just --list
# Build and run the development environment
dev:
# For flexibility, we just build it locally. This can be edited to pull from a remote image
docker build -t dev-container -f Dockerfile .
# Note: running with the volumes mounted in the same directory allows clangd to work
docker run -it --rm -v $(pwd):$(pwd) dev-container -c "cd $(pwd) && /bin/zsh"
# Bootstrap the project when cloning for the first time by installing git hooks
bootstrap:
pre-commit install --hook-type commit-msg --hook-type pre-push
# Recipe to configure the build environment
configure:
@echo "\nBUILD_PREFIX: {{BUILD_PREFIX}}\n\n"
meson setup --buildtype={{BUILD_TYPE}} {{BUILD_PREFIX}}
# Build a target, or default if none is specified
build target="": configure
ninja -C {{BUILD_PREFIX}} {{target}}
# Run the unit tests
test: build
ninja -C {{BUILD_PREFIX}} test
# Coverage recipe
coverage: test
ninja -C {{BUILD_PREFIX}} coverage
# Debug build
debug:
meson configure {{BUILD_PREFIX}} --buildtype=debug
ninja -C {{BUILD_PREFIX}}
# Release build
release:
meson configure {{BUILD_PREFIX}} --buildtype=release
ninja -C {{BUILD_PREFIX}}
# Run tests with address sanitizer
sanitize:
meson configure {{BUILD_PREFIX}} -Db_sanitize=address
ninja -C {{BUILD_PREFIX}}
ninja -C {{BUILD_PREFIX}} test
# Static analysis
check:
ninja -C {{BUILD_PREFIX}} clang-tidy
# Run the autoformatter
format:
ninja -C {{BUILD_PREFIX}} clang-format
# Build the documentation
docs:
ninja -C {{BUILD_PREFIX}} docs/html
# Clean the build directory
clean:
ninja -C {{BUILD_PREFIX}} clean
# Obliterate the build directory
spotless:
rm -rf {{BUILD_PREFIX}}
meson subprojects purge --confirm