Skip to content

Commit

Permalink
Merge pull request #2868 from ziglang/windows-libc
Browse files Browse the repository at this point in the history
provide a libc for windows using mingw-w64
  • Loading branch information
andrewrk authored Jul 12, 2019
2 parents 4e58855 + 39b850c commit 107e574
Show file tree
Hide file tree
Showing 2,132 changed files with 1,455,823 additions and 125 deletions.
2,120 changes: 2,120 additions & 0 deletions CMakeLists.txt

Large diffs are not rendered by default.

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

b.installArtifact(exe);
exe.install();
installStdLib(b, ctx.std_files);
installCHeaders(b, ctx.c_header_files);

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

fn addCppLib(b: *Builder, lib_exe_obj: var, cmake_binary_dir: []const u8, lib_name: []const u8) void {
const lib_prefix = if (lib_exe_obj.target.isWindows()) "" else "lib";
lib_exe_obj.addObjectFile(fs.path.join(b.allocator, [_][]const u8{
cmake_binary_dir,
"zig_cpp",
b.fmt("{}{}{}", lib_prefix, lib_name, lib_exe_obj.target.libFileExt()),
b.fmt("{}{}{}", lib_exe_obj.target.libPrefix(), lib_name, lib_exe_obj.target.staticLibSuffix()),
}) catch unreachable);
}

Expand Down
Loading

0 comments on commit 107e574

Please sign in to comment.