Repository navigation
Expand file tree
/
Copy pathbuild.zig
More file actions
60 lines (52 loc) · 2 KB
/
Copy pathbuild.zig
File metadata and controls
60 lines (52 loc) · 2 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
60
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const raw_window_handle = b.addModule("raw-window-handle", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
const tests_module = b.createModule(.{
.root_source_file = b.path("tests/root.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "raw-window-handle", .module = raw_window_handle },
},
});
const tests = b.addTest(.{ .root_module = tests_module });
const run_tests = b.addRunArtifact(tests);
const compile_probe_module = b.createModule(.{
.root_source_file = b.path("tests/compile.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "raw-window-handle", .module = raw_window_handle },
},
});
const compile_probe = b.addObject(.{
.name = "raw-window-handle-compile-probe",
.root_module = compile_probe_module,
});
const check_step = b.step("check", "Compile the cross-target portability probe");
check_step.dependOn(&compile_probe.step);
const test_step = b.step("test", "Run the raw-window-handle test suite");
test_step.dependOn(&run_tests.step);
const example_module = b.createModule(.{
.root_source_file = b.path("examples/ohos.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "raw-window-handle", .module = raw_window_handle },
},
});
const example = b.addExecutable(.{
.name = "raw-window-handle-ohos-example",
.root_module = example_module,
});
const run_example = b.addRunArtifact(example);
if (b.args) |args| run_example.addArgs(args);
const example_step = b.step("example", "Run the OpenHarmony example");
example_step.dependOn(&run_example.step);
}