-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
60 lines (48 loc) · 1.63 KB
/
Justfile
File metadata and controls
60 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -------------------------
# Config
# -------------------------
# Override on the CLI like: just BUILD_TYPE=Release build
BUILD_DIR := "cmake-build"
BUILD_TYPE := "Release" # Debug | Release | RelWithDebInfo | MinSizeRel
GENERATOR := "" # e.g., -G Ninja
CMAKE_FLAGS := "-DCMAKE_BUILD_TYPE={{BUILD_TYPE}} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
# If you set an install prefix, uncomment the next line (useful for pybind11 modules):
# INSTALL_PREFIX ?= "{{pwd()}}/.local"
# INSTALL_FLAG := "-DCMAKE_INSTALL_PREFIX={{INSTALL_PREFIX}}"
# -------------------------
# Default
# -------------------------
default: configure build test
# -------------------------
# CMake lifecycle
# -------------------------
configure:
cmake -S . -B {{BUILD_DIR}} {{GENERATOR}} {{CMAKE_FLAGS}} -DBUILD_CUDA=ON
build: configure
cmake --build {{BUILD_DIR}} -j
install: build
cmake --install {{BUILD_DIR}}
test: build
ctest --test-dir {{BUILD_DIR}} --output-on-failure -VV
clean:
rm -rf {{BUILD_DIR}}
# -------------------------
# Run binaries (examples)
# -------------------------
# Add more run-* recipes as we add crates
run-kalman:
{{BUILD_DIR}}/crates/kf_linear/kf_demo
# -------------------------
# Linting & formatting
# -------------------------
lint: build
clang-tidy crates/*/src/*.cpp -p {{BUILD_DIR}} -- -std=c++20
fmt:
find crates -type f \( -name '*.cpp' -o -name '*.hpp' \) -exec clang-format -i {} +
fmt-check:
find crates -type f \( -name '*.cpp' -o -name '*.hpp' \) -exec clang-format --dry-run --Werror {} +
# -------------------------
# Book
# -------------------------
serve-book:
mdbook serve book