-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
46 lines (38 loc) · 1.22 KB
/
build.zig
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
const std = @import("std");
pub fn build(b: *std.Build) !void {
const mode = b.standardOptimizeOption(.{});
const tgt = b.standardTargetOptions(.{
.default_target = try std.zig.CrossTarget.parse(.{
.arch_os_abi = "x86_64-windows-gnu",
}),
});
const exe = b.addExecutable(.{
.name = "cracken",
.root_source_file = b.path("cracken.zig"),
.target = tgt,
.optimize = mode,
.win32_manifest = b.path("cracken.manifest"),
});
if (mode != .Debug) {
exe.subsystem = .Windows;
exe.want_lto = true;
}
const flags = .{ "-DUNICODE", "-D_UNICODE", "-DWIN32_LEAN_AND_MEAN" };
const sources = .{
"curve.c",
"krakenwidget.c",
"mainwindow.c",
"window.c",
};
exe.addCSourceFiles(.{ .files = &sources, .flags = &flags });
exe.linkLibC();
exe.linkSystemLibrary("setupapi");
exe.linkSystemLibrary("hid");
exe.linkSystemLibrary("comctl32");
exe.linkSystemLibrary("gdi32");
b.installArtifact(exe);
const run_exe = b.addRunArtifact(exe);
run_exe.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run cracken");
run_step.dependOn(&run_exe.step);
}