-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_happyx.nimble
27 lines (20 loc) · 1.11 KB
/
test_happyx.nimble
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
# Package
version = "0.1.0"
author = "lost22git"
description = "A new awesome nimble package"
license = "MIT"
srcDir = "src"
bin = @["test_happyx"]
binDir = "bin"
# Dependencies
requires "nim >= 2.0.0", "happyx", "mapster >= 1.1.0", "debby", "jsony"
# ------ 参考:https://github.com/ee7/binary-size?tab=readme-ov-file#details
task release, "Build binary with release mode":
const cmd = "nimble build --verbose -d:beast -d:release && mv bin/test_happyx bin/test_happyx_release"
exec cmd
task release_lto, "Build binary with release mode and lto":
const cmd = "nimble build --verbose -d:beast -d:release --passC:-flto --passL:-flto && mv bin/test_happyx bin/test_happyx_release_lto"
exec cmd
task zigcc, "Build static-linking binary with zig cc":
const cmd = """nim c -d:beast -d:release --cc:clang --clang.exe:zigcc --clang.linkerexe:zigcc --passC:-flto --passL:-flto --passC="-target x86_64-linux-musl" --passL="-target x86_64-linux-musl" --dynlibOverride:sqlite3 --passL:libsqlite3.a src/test_happyx.nim && mv src/test_happyx bin/test_happyx_release_zigcc"""
exec cmd