File tree 1 file changed +4
-1
lines changed
zig-code/build-system/mutate-source-files 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
const std = @import ("std" );
2
2
3
3
pub fn build (b : * std.Build ) void {
4
+ const target = b .standardTargetOptions (.{});
4
5
const exe = b .addExecutable (.{
5
6
.name = "demo" ,
6
7
.root_source_file = b .path ("src/main.zig" ),
8
+ .target = target ,
7
9
});
8
10
b .installArtifact (exe );
9
11
10
12
const proto_gen = b .addExecutable (.{
11
13
.name = "proto_gen" ,
12
14
.root_source_file = b .path ("tools/proto_gen.zig" ),
15
+ .target = target ,
13
16
});
14
17
15
18
const run = b .addRunArtifact (proto_gen );
16
19
const generated_protocol_file = run .addOutputFileArg ("protocol.zig" );
17
20
18
- const wf = b .addWriteFiles ();
21
+ const wf = b .addUpdateSourceFiles ();
19
22
wf .addCopyFileToSource (generated_protocol_file , "src/protocol.zig" );
20
23
21
24
const update_protocol_step = b .step ("update-protocol" , "update src/protocol.zig to latest" );
You can’t perform that action at this time.
0 commit comments