build: use standard --release flag for building releases
This commit is contained in:
parent
f795eb71fc
commit
f5bfcd9219
3 changed files with 11 additions and 3 deletions
10
build.zig
10
build.zig
|
@ -4,7 +4,6 @@ const builtin = @import("builtin");
|
|||
const optimize_deps = .ReleaseFast;
|
||||
|
||||
pub fn build(b: *std.Build) void {
|
||||
const release = b.option(bool, "package_release", "Build all release targets") orelse false;
|
||||
const tracy_enabled = b.option(bool, "enable_tracy", "Enable tracy client library (default: no)") orelse false;
|
||||
const use_tree_sitter = b.option(bool, "use_tree_sitter", "Enable tree-sitter (default: yes)") orelse true;
|
||||
const strip = b.option(bool, "strip", "Disable debug information (default: no)");
|
||||
|
@ -24,6 +23,15 @@ pub fn build(b: *std.Build) void {
|
|||
version.appendSlice(b.allocator, "unknown") catch {};
|
||||
};
|
||||
|
||||
const release = switch (b.release_mode) {
|
||||
.off => false,
|
||||
.any => blk: {
|
||||
b.release_mode = .safe;
|
||||
break :blk true;
|
||||
},
|
||||
else => true,
|
||||
};
|
||||
|
||||
return (if (release) &build_release else &build_development)(
|
||||
b,
|
||||
run_step,
|
||||
|
|
|
@ -83,7 +83,7 @@ echo running tests...
|
|||
|
||||
echo building...
|
||||
|
||||
./zig build -Dpackage_release --prefix "$DESTDIR/build"
|
||||
./zig build --release --prefix "$DESTDIR/build"
|
||||
|
||||
VERSION=$(/bin/cat "$DESTDIR/build/version")
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ echo running tests...
|
|||
|
||||
echo building...
|
||||
|
||||
./zig build -Dpackage_release --prefix "$DESTDIR/build"
|
||||
./zig build --release --prefix "$DESTDIR/build"
|
||||
|
||||
cd "$DESTDIR/build"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue