@@ -19,10 +19,11 @@ pub fn build(b: *std.Build) !void {
19
19
break :blk run .addOutputFileArg ("build/browse_py.h" );
20
20
},
21
21
.python = b .option ([]const u8 , "python" , "Python interpreter to use for the browse tool" ) orelse "python" ,
22
+ .strip_override = b .option (bool , "strip" , "Strip the ninja exe" ),
22
23
};
23
24
24
25
{
25
- const exe = addNinja (b , target , optimize , config );
26
+ const exe = addNinja (b , target , optimize , config , .{ . strip_default = false } );
26
27
b .installArtifact (exe );
27
28
}
28
29
@@ -69,19 +70,22 @@ const zon: struct {
69
70
const NinjaConfig = struct {
70
71
browse_py_h : std.Build.LazyPath ,
71
72
python : []const u8 ,
73
+ strip_override : ? bool ,
72
74
};
73
75
74
76
fn addNinja (
75
77
b : * std.Build ,
76
78
target : std.Build.ResolvedTarget ,
77
79
optimize : std.builtin.OptimizeMode ,
78
80
config : NinjaConfig ,
81
+ opt : struct { strip_default : bool },
79
82
) * std.Build.Step.Compile {
80
83
const upstream = b .dependency ("upstream" , .{});
81
84
const exe = b .addExecutable (.{
82
85
.name = "ninja" ,
83
86
.target = target ,
84
87
.optimize = optimize ,
88
+ .strip = config .strip_override orelse opt .strip_default ,
85
89
});
86
90
switch (target .result .os .tag ) {
87
91
.windows = > {},
@@ -182,7 +186,7 @@ fn ci(
182
186
const target_dest_dir : std.Build.InstallDir = .{ .custom = ci_target_str };
183
187
const install = b .step (b .fmt ("install-{s}" , .{ci_target_str }), "" );
184
188
ci_step .dependOn (install );
185
- const exe = addNinja (b , target , optimize , config );
189
+ const exe = addNinja (b , target , optimize , config , .{ . strip_default = true } );
186
190
install .dependOn (
187
191
& b .addInstallArtifact (exe , .{ .dest_dir = .{ .override = target_dest_dir } }).step ,
188
192
);
0 commit comments