@@ -1053,6 +1053,8 @@ pub const LibExeObjStep = struct {
1053
1053
installed_path : ? []const u8 ,
1054
1054
install_step : ? * InstallArtifactStep ,
1055
1055
1056
+ libc_file : ? []const u8 ,
1057
+
1056
1058
const LinkObject = union (enum ) {
1057
1059
StaticPath : []const u8 ,
1058
1060
OtherStep : * LibExeObjStep ,
@@ -1146,6 +1148,7 @@ pub const LibExeObjStep = struct {
1146
1148
.single_threaded = false ,
1147
1149
.installed_path = null ,
1148
1150
.install_step = null ,
1151
+ .libc_file = null ,
1149
1152
};
1150
1153
self .computeOutFileNames ();
1151
1154
return self ;
@@ -1321,6 +1324,10 @@ pub const LibExeObjStep = struct {
1321
1324
self .disable_gen_h = value ;
1322
1325
}
1323
1326
1327
+ pub fn setLibCFile (self : * LibExeObjStep , libc_file : ? []const u8 ) void {
1328
+ self .libc_file = libc_file ;
1329
+ }
1330
+
1324
1331
/// Unless setOutputDir was called, this function must be called only in
1325
1332
/// the make step, from a step that has declared a dependency on this one.
1326
1333
/// To run an executable built with zig build, use `run`, or create an install step and invoke it.
@@ -1525,6 +1532,11 @@ pub const LibExeObjStep = struct {
1525
1532
try zig_args .append ("--single-threaded" );
1526
1533
}
1527
1534
1535
+ if (self .libc_file ) | libc_file | {
1536
+ try zig_args .append ("--libc" );
1537
+ try zig_args .append (builder .pathFromRoot (libc_file ));
1538
+ }
1539
+
1528
1540
switch (self .build_mode ) {
1529
1541
builtin .Mode .Debug = > {},
1530
1542
builtin .Mode .ReleaseSafe = > zig_args .append ("--release-safe" ) catch unreachable ,
0 commit comments