-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
88 lines (64 loc) · 2.26 KB
/
justfile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
set dotenv-load
project := "cpp_project"
# Set to any non-empty string for extra output
verbose := ""
build_dir := "build"
build_type := "Debug"
preset := "conan-" + shell('echo ' + build_type + ' | tr "[:upper:]" "[:lower:]"')
conan := "uv run conan"
conan_build_profile := "default"
conan_host_profile := "default"
# The default target to build if none is provided to the `build` recipe
default_build_target := "all"
# Default target to run if none is provided to the `run` recipe
default_run_target := project
# Default arguments to provide when running the executable if none are provided to the `run` recipe
default_args := ""
# Command that will be invoked to open the `index.html` from the documentation.
# ie. Set to `firefox` so that docs are opened with `firefox index.html`
default_browser := "xdg-open"
# The default editor to edit configuration files with
default_editor := "hx"
venv:
uv venv --python 3.13
py-deps reinstall="0":
uv pip install --upgrade -e . \
{{ if reinstall == "1" { "--reinstall" } else { "" } }}
# This only creates the profile, you still need to edit it to contain the details for your compiler and language
conan-profile:
{{ conan }} profile detect --force
edit-conan-profile editor=default_editor profile="default":
{{ editor }} $({{ conan }} config home)/profiles/{{ profile }}
conan-deps:
BUILD_DIR={{ build_dir }} \
{{ conan }} \
install . \
-b missing \
-pr:b {{ conan_build_profile }} \
-pr:h {{ conan_host_profile }} \
-s build_type={{ build_type }}
config config_preset="conan-default":
cmake \
-S . \
-B {{ build_dir }} \
--preset {{ config_preset }}
build target=default_build_target:
cmake \
--build {{ build_dir }} \
--preset {{ preset }} \
{{ if target != "" { "-t " + target } else { "" } }} \
{{ if verbose != "" { "-v" } else { "" } }}
run target=default_run_target *args=default_args:
./{{ build_dir }}/src/{{ build_type }}/{{ if target == "all" { project } else { target } }} {{ args }}
docs browser=default_browser:
{{ browser }} $(realpath {{ build_dir }})/docs/html/index.html
test:
ctest \
--preset {{ preset }} \
{{ if verbose != "" { "--extra-verbose" } else { "" } }}
pre-commit:
uv run pre-commit install
clean:
rm -rf {{ build_dir }}
clean-conan:
{{ conan }} remove "*"