-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
34 lines (25 loc) · 1001 Bytes
/
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
set shell := ['nu', '--commands']
BUILD_DIR := '.build'
SOURCE_FILES_GLOB := 'src/**/*.{c,h}'
all: fmt config lint test
# Generate build system files into `.build/` via CMake.
config:
cmake --preset=default -B '{{ BUILD_DIR }}' .
# Build all targets in the `.build/` folder via CMake.
build config='Debug':
cmake --build '{{ BUILD_DIR }}' --config '{{ config }}'
# Run the unit tests for the given configuration.
test config='Debug': (build config)
ctest --preset=default --build-config '{{ config }}'
# Lint the code with Clang Tidy.
lint:
clang-tidy --quiet -p '{{ BUILD_DIR }}' ...(glob '{{ SOURCE_FILES_GLOB }}')
# Apply lint fix suggestions from Clang Tidy.
fix-lint:
clang-tidy --quiet --fix -p '{{ BUILD_DIR }}' ...(glob '{{ SOURCE_FILES_GLOB }}')
# Check code formatting with Clang Format.
fmt:
clang-format --dry-run ...(glob '{{ SOURCE_FILES_GLOB }}')
# Fix code formatting with Clang Format.
fix-fmt:
clang-format -i ...(glob '{{ SOURCE_FILES_GLOB }}')