-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
82 lines (67 loc) · 2.15 KB
/
Copy pathjustfile
File metadata and controls
82 lines (67 loc) · 2.15 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
# Enter the Nix development environment
dev:
nix develop
# Configure the project with CMake
configure:
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_COLOR_DIAGNOSTICS=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
# Build the project using Ninja
build:
#!/usr/bin/env bash
if [[ ! -f build/build.ninja || CMakeLists.txt -nt build/build.ninja ]]; then
echo "Configuring..."
just configure
fi
cmake --build build -- -j$(nproc)
# Runs the game using the dedicated Nvidia/AMD GPU with optional config
[default]
run config="":
#!/usr/bin/env bash
if command -v nvidia-smi > /dev/null 2>&1; then
export DRI_PRIME=1
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
elif lsmod | grep -i "amdgpu" > /dev/null 2>&1; then
export DRI_PRIME=1
fi
just run-int {{ config }}
# Run the game/application on the integrated GPU for testing/sanity checks
run-int config="": build
./bin/ArenaRush {{ if config != "" { "-c " + config } else { "" } }}
# Package the project using Nix
package:
nix build .
# Remove build artifacts
clean:
rm -rf build bin
# ------ Linux setup and test targets ------
# Setup imgcmp for Linux
[linux]
_setup-imgcmp:
cp scripts/imgcmp-bin/imgcmp-linux scripts/imgcmp
chmod +x scripts/imgcmp
# Run tests for specified test cases
[linux]
run-tests *TESTS: build _setup-imgcmp
pwsh -File scripts/run-all.ps1 {{ TESTS }}
# Compare screenshots for tests
[linux]
compare *TESTS: _setup-imgcmp
pwsh -File scripts/compare-all.ps1 {{ TESTS }}
# ------ Windows setup and test targets ------
# Setup imgcmp for Windows
[windows]
_setup-imgcmp:
cp scripts/imgcmp-bin/imgcmp-win.exe scripts/imgcmp.exe
# Run tests for specified test cases
[windows]
run-tests *TESTS: build _setup-imgcmp
powershell -ExecutionPolicy Bypass -File scripts/run-all.ps1 {{ TESTS }}
# Compare screenshots for tests
[windows]
compare *TESTS: _setup-imgcmp
powershell -ExecutionPolicy Bypass -File scripts/compare-all.ps1 {{ TESTS }}
# Full pipeline: run tests then compare
test *TESTS: (run-tests TESTS) (compare TESTS)