-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
53 lines (44 loc) · 1.78 KB
/
Copy pathbuild.zig
File metadata and controls
53 lines (44 loc) · 1.78 KB
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
//:_________________________________________________________________
// osdf | Copyright (C) Ivan Mar (sOkam!) | GPL-3.0-or-later :
//:_________________________________________________________________
// @deps confy
const confy = @import("confy");
// @deps builder
const Engine = @import("./src/build/engine.zig").Engine;
//______________________________________
// @section Configuration Options
//____________________________
pub const release = true; // Whether we are building a release or debug version
pub const distribute = release and false; // Prepare the output for distribution (manual or automated) when true
pub const publish = distribute and false; // Publish to the relevant platforms when true
//______________________________________
// @section Package Information
//____________________________
const cfg = @import("./src/build/cfg.zig");
//______________________________________
// @section Buildsystem Entry Point
//____________________________
pub fn main (P :confy.Process) !void {
//__________________
// Build Targets
var engine = try Engine.create(P, .{.release= release, .pkg= cfg.package});
//__________________
// Target System
const systems =
if (distribute) confy.System.desktops()
else &.{confy.System.host()};
//__________________
// Order to Build
cfg.package.report();
try engine.buildFor(systems);
confy.echo(cfg.package.name.short++": Done building.");
}
//______________________________________
// @section Zig Buildsystem: Error Message
//____________________________
pub fn build (b :*@import("std").Build) void {_=b; @import("std").debug.print(
\\[ERROR] `zig build` is not supported.
\\ Use `confy build` instead.
\\ https://codeberg.org/heysokam/confy/releases {s}
, .{"\n"});
}