Skip to content

Commit 224b832

Browse files
Merge pull request #2 from sethvincent/target-optimize
use target and optimize
2 parents a24e889 + 4c4582f commit 224b832

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

build.zig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
const std = @import("std");
22

33
pub fn build(b: *std.Build) void {
4+
const target = b.standardTargetOptions(.{});
5+
const optimize = b.standardOptimizeOption(.{});
6+
47
const entry = b.path("src/root.zig");
5-
const lib = b.addModule("datetime", .{ .root_source_file = entry });
6-
const lib_unit_tests = b.addTest(.{ .root_source_file = entry });
8+
const lib = b.addModule("datetime", .{
9+
.root_source_file = entry,
10+
.target = target,
11+
.optimize = optimize,
12+
});
13+
const lib_unit_tests = b.addTest(.{
14+
.root_source_file = entry,
15+
.target = target,
16+
.optimize = optimize,
17+
});
718
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
819

920
const demo = b.addTest(.{
1021
.name = "demo",
1122
.root_source_file = b.path("demos.zig"),
23+
.target = target,
24+
.optimize = optimize,
1225
});
1326
demo.root_module.addImport("datetime", lib);
1427
const run_demo = b.addRunArtifact(demo);

0 commit comments

Comments
 (0)