-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
59 lines (55 loc) · 1.99 KB
/
Copy pathbuild.zig
File metadata and controls
59 lines (55 loc) · 1.99 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
53
54
55
56
57
58
59
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
//
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the
// Mozilla Public License, v. 2.0.
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const injector_optimize = b.option(
std.builtin.OptimizeMode,
"injector-optimize",
"Optimization for the injector (defaults to -Doptimize)",
) orelse optimize;
{
const mod = b.createModule(.{
.root_source_file = b.path("Hauyne.Bootstrap/bootstrap.zig"),
.target = target,
.optimize = optimize,
});
mod.link_libc = true;
if (target.result.os.tag != .windows) {
mod.linkSystemLibrary("dl", .{});
mod.linkSystemLibrary("pthread", .{});
}
const lib = b.addLibrary(.{
.name = "Hauyne.Bootstrap",
.root_module = mod,
.linkage = .dynamic,
});
const install = b.addInstallArtifact(lib, .{
.dest_dir = .{ .override = .{ .custom = "" } },
});
b.getInstallStep().dependOn(&install.step);
}
{
const mod = b.createModule(.{
.root_source_file = b.path("Hauyne.Injector/injector.zig"),
.target = target,
.optimize = injector_optimize,
});
mod.link_libc = true;
if (target.result.os.tag != .windows) {
mod.linkSystemLibrary("dl", .{});
}
const exe = b.addExecutable(.{
.name = "Hauyne.Injector",
.root_module = mod,
});
const install = b.addInstallArtifact(exe, .{
.dest_dir = .{ .override = .{ .custom = "" } },
});
b.getInstallStep().dependOn(&install.step);
}
}