-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
66 lines (55 loc) · 1.44 KB
/
Taskfile.yml
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
version: "3"
tasks:
init:
cmds:
- echo "os init"
# with zig v0.6.0, support `-femit-h` option
docker:build:
cmds:
# - docker pull euantorano/zig:0.6.0
- docker run --platform linux/x86_64 --rm -v $PWD:/app euantorano/zig:0.6.0 build-lib src/main.zig -femit-h
- cp *.h src/
- rm *.h;
# gen c header, zig v0.9+ (直接生成的头文件, 包含大量冗余代码, 且编译报错, 不 work)
gen:
cmds:
- zig build-lib -fno-stage1 -femit-h src/mathtest.zig
- cp *.h src/
- rm *.h;
# https://ziglang.org/download/0.8.0/release-notes.html#Support-Table
build:
cmds:
- zig build
- zig build -Dtarget=x86_64-linux
- zig build -Dtarget=x86_64-macos
- zig build -Dtarget=x86_64-windows
- zig build -Dtarget=aarch64-macos
- ls -al zig-out/lib/
# - ls -al .
ignore_error: true
run:
cmds:
- zig build run # --verbose-cc # 打印编译细节
test:
cmds:
- zig build test
mod:init:
cmds:
- zigmod init
# build:lib:
# cmds:
# - zig build-lib src/mathtest.zig -femit-h -femit-h
# build:lib:shared:
# cmds:
# - zig build-lib src/mathtest.zig -dynamic -femit-h
# build:exe:
# cmds:
# - zig build-exe --library libzigmath.a src/main.c
clean:
cmds:
- rm -rf zig-cache/;
- rm -rf zig-out/;
- rm *.a;
- rm *.o;
- rm *.dylib;
ignore_error: true