fix(build): don't declare d2d mutiple times in package_release builds
This commit is contained in:
parent
9cc5c9711b
commit
d58f1964bf
1 changed files with 9 additions and 7 deletions
16
build.zig
16
build.zig
|
@ -9,6 +9,7 @@ pub fn build(b: *std.Build) void {
|
||||||
const use_llvm = b.option(bool, "use_llvm", "Enable llvm backend (default: none)");
|
const use_llvm = b.option(bool, "use_llvm", "Enable llvm backend (default: none)");
|
||||||
const pie = b.option(bool, "pie", "Produce an executable with position independent code (default: none)");
|
const pie = b.option(bool, "pie", "Produce an executable with position independent code (default: none)");
|
||||||
const gui = b.option(bool, "gui", "Standalone GUI mode") orelse false;
|
const gui = b.option(bool, "gui", "Standalone GUI mode") orelse false;
|
||||||
|
const d2d = if (gui) b.option(bool, "d2d", "use the Direct2D backend (instead of Direct3D11)") orelse false else false;
|
||||||
|
|
||||||
const run_step = b.step("run", "Run the app");
|
const run_step = b.step("run", "Run the app");
|
||||||
const check_step = b.step("check", "Check the app");
|
const check_step = b.step("check", "Check the app");
|
||||||
|
@ -27,6 +28,7 @@ pub fn build(b: *std.Build) void {
|
||||||
use_llvm,
|
use_llvm,
|
||||||
pie,
|
pie,
|
||||||
gui,
|
gui,
|
||||||
|
d2d,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +44,7 @@ fn build_development(
|
||||||
use_llvm: ?bool,
|
use_llvm: ?bool,
|
||||||
pie: ?bool,
|
pie: ?bool,
|
||||||
gui: bool,
|
gui: bool,
|
||||||
|
d2d: bool,
|
||||||
) void {
|
) void {
|
||||||
const target = b.standardTargetOptions(.{ .default_target = .{ .abi = if (builtin.os.tag == .linux and !tracy_enabled) .musl else null } });
|
const target = b.standardTargetOptions(.{ .default_target = .{ .abi = if (builtin.os.tag == .linux and !tracy_enabled) .musl else null } });
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
@ -61,6 +64,7 @@ fn build_development(
|
||||||
use_llvm,
|
use_llvm,
|
||||||
pie,
|
pie,
|
||||||
gui,
|
gui,
|
||||||
|
d2d,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +80,7 @@ fn build_release(
|
||||||
use_llvm: ?bool,
|
use_llvm: ?bool,
|
||||||
pie: ?bool,
|
pie: ?bool,
|
||||||
_: bool, //gui
|
_: bool, //gui
|
||||||
|
d2d: bool,
|
||||||
) void {
|
) void {
|
||||||
const targets: []const std.Target.Query = &.{
|
const targets: []const std.Target.Query = &.{
|
||||||
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl },
|
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl },
|
||||||
|
@ -118,6 +123,7 @@ fn build_release(
|
||||||
use_llvm,
|
use_llvm,
|
||||||
pie,
|
pie,
|
||||||
false, //gui
|
false, //gui
|
||||||
|
false, //d2d
|
||||||
);
|
);
|
||||||
|
|
||||||
if (t.os_tag == .windows)
|
if (t.os_tag == .windows)
|
||||||
|
@ -136,6 +142,7 @@ fn build_release(
|
||||||
use_llvm,
|
use_llvm,
|
||||||
pie,
|
pie,
|
||||||
true, //gui
|
true, //gui
|
||||||
|
d2d,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,19 +162,14 @@ pub fn build_exe(
|
||||||
use_llvm: ?bool,
|
use_llvm: ?bool,
|
||||||
pie: ?bool,
|
pie: ?bool,
|
||||||
gui: bool,
|
gui: bool,
|
||||||
|
d2d: bool,
|
||||||
) void {
|
) void {
|
||||||
const options = b.addOptions();
|
const options = b.addOptions();
|
||||||
options.addOption(bool, "enable_tracy", tracy_enabled);
|
options.addOption(bool, "enable_tracy", tracy_enabled);
|
||||||
options.addOption(bool, "use_tree_sitter", use_tree_sitter);
|
options.addOption(bool, "use_tree_sitter", use_tree_sitter);
|
||||||
options.addOption(bool, "strip", strip);
|
options.addOption(bool, "strip", strip);
|
||||||
options.addOption(bool, "gui", gui);
|
options.addOption(bool, "gui", gui);
|
||||||
if (gui) {
|
options.addOption(bool, "d2d", d2d);
|
||||||
options.addOption(bool, "d2d", b.option(
|
|
||||||
bool,
|
|
||||||
"d2d",
|
|
||||||
"use the Direct2D backend (instead of Direct3D11)",
|
|
||||||
) orelse false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const options_mod = options.createModule();
|
const options_mod = options.createModule();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue