-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
44 lines (36 loc) · 1.41 KB
/
build.zig
File metadata and controls
44 lines (36 loc) · 1.41 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
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// zig-golden-float dependency
const zig_golden_float = b.dependency("zig_golden_float", .{
.target = target,
.optimize = optimize,
});
// Library module
const hdc_mod = b.addModule("zig-hdc", .{
.root_source_file = b.path("src/sequence_hdc.zig"),
});
// Add zig-golden-float as import
hdc_mod.addImport("zig_golden_float", zig_golden_float.module("golden-float"));
// Export VSA facade
const vsa_mod = b.addModule("zig-hdc-vsa", .{
.root_source_file = b.path("src/vsa.zig"),
});
vsa_mod.addImport("zig_golden_float", zig_golden_float.module("golden-float"));
// Export sequence_hdc module
const seq_mod = b.addModule("zig-hdc-sequence", .{
.root_source_file = b.path("src/sequence_hdc.zig"),
});
seq_mod.addImport("zig_golden_float", zig_golden_float.module("golden-float"));
// Tests
const tests = b.addTest(.{
.root_source_file = b.path("src/vsa.zig"),
.target = target,
.optimize = optimize,
});
tests.root_module.addImport("zig_golden_float", zig_golden_float.module("golden-float"));
b.installArtifact(tests);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&b.addRunArtifact(tests).step);
}