| ... | @@ -54,6 +54,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D | ... | @@ -54,6 +54,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D |
| 54 | try w.writeAll("const string = []const u8;\n"); | 54 | try w.writeAll("const string = []const u8;\n"); |
| 55 | try w.writeAll("\n"); | 55 | try w.writeAll("\n"); |
| 56 | try w.print("pub const cache = \"{}\";\n", .{std.zig.fmtEscapes(cachepath)}); | 56 | try w.print("pub const cache = \"{}\";\n", .{std.zig.fmtEscapes(cachepath)}); |
| | 57 | try w.writeAll("pub var skip_libc = false;\n"); |
| 57 | try w.writeAll("\n"); | 58 | try w.writeAll("\n"); |
| 58 | try w.writeAll( | 59 | try w.writeAll( |
| 59 | \\pub fn addAllTo(exe: *std.Build.Step.Compile) void { | 60 | \\pub fn addAllTo(exe: *std.Build.Step.Compile) void { |
| ... | @@ -92,6 +93,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D | ... | @@ -92,6 +93,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D |
| 92 | \\ const result = b.createModule(.{ | 93 | \\ const result = b.createModule(.{ |
| 93 | \\ .target = exe.root_module.resolved_target, | 94 | \\ .target = exe.root_module.resolved_target, |
| 94 | \\ }); | 95 | \\ }); |
| | 96 | \\ const target = result.resolved_target.?.result; |
| 95 | \\ if (self.import) |capture| { | 97 | \\ if (self.import) |capture| { |
| 96 | \\ result.root_source_file = capture[1]; | 98 | \\ result.root_source_file = capture[1]; |
| 97 | \\ } | 99 | \\ } |
| ... | @@ -117,6 +119,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D | ... | @@ -117,6 +119,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D |
| 117 | \\ link_lib_c = true; | 119 | \\ link_lib_c = true; |
| 118 | \\ } | 120 | \\ } |
| 119 | \\ for (self.system_libs) |item| { | 121 | \\ for (self.system_libs) |item| { |
| | 122 | \\ if (skip_libc and std.zig.target.isLibCLibName(target, item)) continue; |
| 120 | \\ result.linkSystemLibrary(item, .{}); | 123 | \\ result.linkSystemLibrary(item, .{}); |
| 121 | \\ exe.linkSystemLibrary(item); | 124 | \\ exe.linkSystemLibrary(item); |
| 122 | \\ link_lib_c = true; | 125 | \\ link_lib_c = true; |
| ... | @@ -126,7 +129,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D | ... | @@ -126,7 +129,7 @@ pub fn create_depszig(alloc: std.mem.Allocator, cachepath: string, dir: std.fs.D |
| 126 | \\ exe.linkFramework(item); | 129 | \\ exe.linkFramework(item); |
| 127 | \\ link_lib_c = true; | 130 | \\ link_lib_c = true; |
| 128 | \\ } | 131 | \\ } |
| 129 | \\ if (link_lib_c) { | 132 | \\ if (link_lib_c and !skip_libc) { |
| 130 | \\ result.link_libc = true; | 133 | \\ result.link_libc = true; |
| 131 | \\ exe.linkLibC(); | 134 | \\ exe.linkLibC(); |
| 132 | \\ } | 135 | \\ } |