Zig build system updated: can compile static binaries.
This commit is contained in:
parent
0585110df4
commit
b567a25969
@ -1,6 +1,7 @@
|
||||
ifdef STATIC
|
||||
STATIC_BUILD ?= -static
|
||||
CRYSTAL_STATIC_BUILD ?= --static
|
||||
ZIG_STATIC_BUILD ?= -Dstatic=true
|
||||
endif
|
||||
|
||||
# For interactive completion in the shell.
|
||||
|
@ -58,4 +58,12 @@ pub fn build(b: *std.Build) void {
|
||||
.optimize = optimize,
|
||||
});
|
||||
link_and_install(pongd_exe);
|
||||
|
||||
const is_static = b.option(bool, "static", "Compile static binaries.") orelse false;
|
||||
if (is_static) {
|
||||
ipcd_exe.linkage = .static;
|
||||
tcpd_exe.linkage = .static;
|
||||
pong_exe.linkage = .static;
|
||||
pongd_exe.linkage = .static;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
all: build
|
||||
|
||||
include ../mk/makefile.utils
|
||||
|
||||
update-libipc:
|
||||
git submodule update
|
||||
|
||||
ZIG_OPTS ?=
|
||||
ZIG_OPTIM ?= ReleaseSafe
|
||||
build:
|
||||
zig build -Doptimize=$(ZIG_OPTIM) $(ZIG_OPTS)
|
||||
zig build -Doptimize=$(ZIG_OPTIM) $(ZIG_OPTS) $(ZIG_STATIC_BUILD)
|
||||
|
Loading…
Reference in New Issue
Block a user