Repository navigation
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
144 lines (119 loc) · 3.59 KB
/
Copy pathTaskfile.yaml
File metadata and controls
144 lines (119 loc) · 3.59 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
version: "3"
vars:
BUILD_DIR: build
# Suppress macOS malloc nano zone warning when using AddressSanitizer
# (nano allocator conflicts with ASan's memory layout, but fallback is harmless)
env:
MallocNanoZone: 0
tasks:
# --------------------------------------------------
# Setup
# --------------------------------------------------
configure:
desc: Configure CMake build directory
cmds:
# Suppress CMake author warnings, including Raylib's macOS OpenGL deprecation notice
- cmake -Wno-author -S . -B {{.BUILD_DIR}}
# clangd looks for compile_commands.json in root directory
- ln -sf {{.BUILD_DIR}}/compile_commands.json ./compile_commands.json
clean:
desc: Remove build artifacts
cmds:
- rm -rf {{.BUILD_DIR}} compile_commands.json
# --------------------------------------------------
# Build
# --------------------------------------------------
build:
desc: Build everything
cmds:
- cmake --build {{.BUILD_DIR}}
build:base:
desc: Build base lib
cmds:
- cmake --build {{.BUILD_DIR}} --target base
build:scratch:
desc: Build Scratch
cmds:
- cmake --build {{.BUILD_DIR}} --target scratch
build:bean:
desc: Build Bean
cmds:
- cmake --build {{.BUILD_DIR}} --target bean
build:dodge:
desc: Build Dodge
cmds:
- cmake --build {{.BUILD_DIR}} --target dodge
build:particle:
desc: Build particle
cmds:
- cmake --build {{.BUILD_DIR}} --target particle
# --------------------------------------------------
# Run
# --------------------------------------------------
run:scratch:
desc: Run Scratch
deps: [build:scratch]
vars:
STATS_PATH: data/stats.txt
cmds:
- cd {{.BUILD_DIR}}/scratch && ./scratch {{.STATS_PATH}}
run:bean:
desc: Run Bean
deps: [build:bean]
cmds:
- ./{{.BUILD_DIR}}/bean/bean {{.CLI_ARGS}}
run:dodge:
desc: Run Dodge
deps: [build:dodge]
cmds:
- cd {{.BUILD_DIR}}/dodge && ./dodge
run:particle:
desc: Run Particle
deps: [build:particle]
cmds:
- cd {{.BUILD_DIR}}/particle && ./particle
# --------------------------------------------------
# Test
# --------------------------------------------------
test:
desc: Run all tests
deps: [build]
cmds:
- cd {{.BUILD_DIR}} && ctest --output-on-failure
test:bean:
desc: Run Bean tests
deps: [build:bean]
cmds:
- ./bean/test.sh
test:math_lib:
desc: Run math_lib tests
cmds:
- cmake --build {{.BUILD_DIR}} --target test_math_utils
- cmake --build {{.BUILD_DIR}} --target test_foo
- ./{{.BUILD_DIR}}/libs/math_lib/test_math_utils
- ./{{.BUILD_DIR}}/libs/math_lib/test_foo
test:base:
desc: Run base tests
cmds:
- cmake --build {{.BUILD_DIR}} --target test_arena
- ./{{.BUILD_DIR}}/libs/base/test_arena
- cmake --build {{.BUILD_DIR}} --target test_pool
- ./{{.BUILD_DIR}}/libs/base/test_pool
- cmake --build {{.BUILD_DIR}} --target test_strings
- ./{{.BUILD_DIR}}/libs/base/test_strings
# --------------------------------------------------
# Tools
# --------------------------------------------------
format:
desc: Run clang-format
cmds:
- |
git ls-files '*.c' '*.h' | xargs clang-format -i
lint:
desc: Run clang-tidy (compile_commands.json must exist)
cmds:
# macOS only: --extra-arg to help clang-tidy find system headers
- |
git ls-files '*.c' '*.h' | xargs clang-tidy \
--extra-arg=-isysroot --extra-arg=$(xcrun --show-sdk-path) \
-p {{.BUILD_DIR}}