Skip to content

Commit c2afbda

Browse files
committed
unify build.zig
1 parent 9828720 commit c2afbda

12 files changed

Lines changed: 368 additions & 495 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
build-type: [client, server]
34+
skip-build: [client, server]
3535
tracy-flag: [true, false]
3636
opt: [Debug, ReleaseSafe]
3737
runs-on: ubuntu-latest
@@ -50,13 +50,12 @@ jobs:
5050
version: 1.4.309.0
5151
cache: true
5252
- name: Build
53-
working-directory: ./${{ matrix.build-type }}
54-
run: zig build -Denable_tracy=${{ matrix.tracy-flag }} -Doptimize=${{ matrix.opt }}
53+
run: zig build -D${{ matrix.skip-build }}=false -Dtracy=${{ matrix.tracy-flag }} -Doptimize=${{ matrix.opt }}
5554
build-windows:
5655
strategy:
5756
fail-fast: false
5857
matrix:
59-
build-type: [client, server]
58+
skip-build: [client, server]
6059
tracy-flag: [true, false]
6160
opt: [Debug, ReleaseSafe]
6261
runs-on: windows-latest
@@ -71,5 +70,4 @@ jobs:
7170
version: 1.4.309.0
7271
cache: true
7372
- name: Build
74-
working-directory: ./${{ matrix.build-type }}
75-
run: zig build -Denable_tracy=${{ matrix.tracy-flag }} -Doptimize=${{ matrix.opt }}
73+
run: zig build -D${{ matrix.skip-build }}=false -Dtracy=${{ matrix.tracy-flag }} -Doptimize=${{ matrix.opt }}

.vscode/launch.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,63 @@
55
"name": "Debug Client",
66
"type": "lldb",
77
"request": "launch",
8-
"program": "${workspaceFolder}/client/zig-out/bin/Eclipse",
8+
"program": "${workspaceFolder}/zig-out/client/Eclipse",
99
"args": [],
10-
"cwd": "${workspaceFolder}/client/zig-out/bin",
10+
"cwd": "${workspaceFolder}/zig-out/client",
1111
"preLaunchTask": "Debug Client"
1212
},
1313
{
1414
"name": "Debug Client (Validation)",
1515
"type": "lldb",
1616
"request": "launch",
17-
"program": "${workspaceFolder}/client/zig-out/bin/Eclipse",
17+
"program": "${workspaceFolder}/zig-out/client/Eclipse",
1818
"args": [],
19-
"cwd": "${workspaceFolder}/client/zig-out/bin",
19+
"cwd": "${workspaceFolder}/zig-out/client",
2020
"preLaunchTask": "Debug Client (Validation)"
2121
},
2222
{
2323
"name": "Debug Client (Tracy)",
2424
"type": "lldb",
2525
"request": "launch",
26-
"program": "${workspaceFolder}/client/zig-out/bin/Eclipse",
26+
"program": "${workspaceFolder}/zig-out/client/Eclipse",
2727
"args": [],
28-
"cwd": "${workspaceFolder}/client/zig-out/bin",
28+
"cwd": "${workspaceFolder}/zig-out/client",
2929
"preLaunchTask": "Debug Client (Tracy)"
3030
},
3131
{
3232
"name": "ReleaseSafe Client",
3333
"type": "lldb",
3434
"request": "launch",
35-
"program": "${workspaceFolder}/client/zig-out/bin/Eclipse",
35+
"program": "${workspaceFolder}/zig-out/client/Eclipse",
3636
"args": [],
37-
"cwd": "${workspaceFolder}/client/zig-out/bin",
37+
"cwd": "${workspaceFolder}/zig-out/client",
3838
"preLaunchTask": "ReleaseSafe Client"
3939
},
4040
{
4141
"name": "Debug Server",
4242
"type": "lldb",
4343
"request": "launch",
44-
"program": "${workspaceFolder}/server/zig-out/bin/Eclipse",
44+
"program": "${workspaceFolder}/zig-out/server/Eclipse",
4545
"args": [],
46-
"cwd": "${workspaceFolder}/server/zig-out/bin",
46+
"cwd": "${workspaceFolder}/zig-out/server",
4747
"preLaunchTask": "Debug Server"
4848
},
4949
{
5050
"name": "Debug Server (Tracy)",
5151
"type": "lldb",
5252
"request": "launch",
53-
"program": "${workspaceFolder}/server/zig-out/bin/Eclipse",
53+
"program": "${workspaceFolder}/zig-out/server/Eclipse",
5454
"args": [],
55-
"cwd": "${workspaceFolder}/server/zig-out/bin",
55+
"cwd": "${workspaceFolder}/zig-out/server",
5656
"preLaunchTask": "Debug Server (Tracy)"
5757
},
5858
{
5959
"name": "ReleaseSafe Server",
6060
"type": "lldb",
6161
"request": "launch",
62-
"program": "${workspaceFolder}/server/zig-out/bin/Eclipse",
62+
"program": "${workspaceFolder}/zig-out/server/Eclipse",
6363
"args": [],
64-
"cwd": "${workspaceFolder}/server/zig-out/bin",
64+
"cwd": "${workspaceFolder}/zig-out/server",
6565
"preLaunchTask": "ReleaseSafe Server"
6666
},
6767
]

.vscode/tasks.json

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,37 @@
66
{
77
"label": "Debug Client",
88
"type": "shell",
9-
"command": "zig build -Doptimize=Debug -freference-trace",
10-
"options": {
11-
"cwd": "${workspaceFolder}/client"
12-
},
9+
"command": "zig build -Dserver=false -Doptimize=Debug -freference-trace",
1310
},
1411
{
1512
"label": "Debug Client (Tracy)",
1613
"type": "shell",
17-
"command": "zig build -Doptimize=Debug -Denable_tracy=true -freference-trace",
18-
"options": {
19-
"cwd": "${workspaceFolder}/client"
20-
},
14+
"command": "zig build -Dserver=false -Doptimize=Debug -Dtracy=true -freference-trace",
2115
},
2216
{
2317
"label": "Debug Client (Validation)",
2418
"type": "shell",
25-
"command": "zig build -Doptimize=Debug -Denable_validation_layers=true -freference-trace",
26-
"options": {
27-
"cwd": "${workspaceFolder}/client"
28-
},
19+
"command": "zig build -Dserver=false -Doptimize=Debug -Dvk_validation=true -freference-trace",
2920
},
3021
{
3122
"label": "ReleaseSafe Client",
3223
"type": "shell",
33-
"command": "zig build -Doptimize=ReleaseSafe -freference-trace",
34-
"options": {
35-
"cwd": "${workspaceFolder}/client"
36-
},
24+
"command": "zig build -Dserver=false -Doptimize=ReleaseSafe -freference-trace",
3725
},
3826
{
3927
"label": "Debug Server",
4028
"type": "shell",
41-
"command": "zig build -Doptimize=Debug -freference-trace",
42-
"options": {
43-
"cwd": "${workspaceFolder}/server"
44-
},
29+
"command": "zig build -Dclient=false -Doptimize=Debug -freference-trace",
4530
},
4631
{
4732
"label": "Debug Server (Tracy)",
4833
"type": "shell",
49-
"command": "zig build -Doptimize=Debug -Denable_tracy=true -freference-trace",
50-
"options": {
51-
"cwd": "${workspaceFolder}/server"
52-
},
34+
"command": "zig build -Dclient=false -Doptimize=Debug -Dtracy=true -freference-trace",
5335
},
54-
5536
{
5637
"label": "ReleaseSafe Server",
5738
"type": "shell",
58-
"command": "zig build -Doptimize=ReleaseSafe -freference-trace",
59-
"options": {
60-
"cwd": "${workspaceFolder}/server"
61-
},
39+
"command": "zig build -Dclient=false -Doptimize=ReleaseSafe -freference-trace",
6240
},
6341
]
6442
}

0 commit comments

Comments
 (0)