Skip to content

Commit 107e574

Browse files
authored
Merge pull request #2868 from ziglang/windows-libc
provide a libc for windows using mingw-w64
2 parents 4e58855 + 39b850c commit 107e574

File tree

2,132 files changed

+1455823
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,132 files changed

+1455823
-125
lines changed

CMakeLists.txt

Lines changed: 2120 additions & 0 deletions
Large diffs are not rendered by default.

build.zig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ pub fn build(b: *Builder) !void {
7878
// TODO re-enable this after https://github.com/ziglang/zig/issues/2377
7979
//test_step.dependOn(&exe.step);
8080
}
81-
const verbose_link_exe = b.option(bool, "verbose-link", "Print link command for self hosted compiler") orelse false;
82-
exe.setVerboseLink(verbose_link_exe);
8381

84-
b.installArtifact(exe);
82+
exe.install();
8583
installStdLib(b, ctx.std_files);
8684
installCHeaders(b, ctx.c_header_files);
8785

@@ -176,11 +174,10 @@ fn fileExists(filename: []const u8) !bool {
176174
}
177175

178176
fn addCppLib(b: *Builder, lib_exe_obj: var, cmake_binary_dir: []const u8, lib_name: []const u8) void {
179-
const lib_prefix = if (lib_exe_obj.target.isWindows()) "" else "lib";
180177
lib_exe_obj.addObjectFile(fs.path.join(b.allocator, [_][]const u8{
181178
cmake_binary_dir,
182179
"zig_cpp",
183-
b.fmt("{}{}{}", lib_prefix, lib_name, lib_exe_obj.target.libFileExt()),
180+
b.fmt("{}{}{}", lib_exe_obj.target.libPrefix(), lib_name, lib_exe_obj.target.staticLibSuffix()),
184181
}) catch unreachable);
185182
}
186183

0 commit comments

Comments
 (0)