glfw: remove self-hosted compiler workaround
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
70b8d52c77
commit
e8c171f8ab
1 changed files with 0 additions and 12 deletions
12
build.zig
12
build.zig
|
@ -69,20 +69,8 @@ pub const pkg = std.build.Pkg{
|
||||||
.source = .{ .path = sdkPath("/src/main.zig") },
|
.source = .{ .path = sdkPath("/src/main.zig") },
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(self-hosted): HACK: workaround https://github.com/ziglang/zig/issues/12784
|
|
||||||
//
|
|
||||||
// Extracted from a build using stage1 from zig-cache/ (`cimport/c_darwin_native.zig`)
|
|
||||||
// Then find+replace `= ?fn` -> `= ?*const fn`
|
|
||||||
fn cimportWorkaround() void {
|
|
||||||
const dest_dir = std.fs.cwd().openDir(sdkPath("/src"), .{}) catch unreachable;
|
|
||||||
const cn_path = sdkPath("/src/cimport/" ++ if (builtin.os.tag == .macos) "c_darwin_native.zig" else "c_normal_native.zig");
|
|
||||||
std.fs.cwd().copyFile(cn_path, dest_dir, sdkPath("/src/c_native.zig"), .{}) catch unreachable;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const LinkError = error{FailedToLinkGPU} || BuildError;
|
pub const LinkError = error{FailedToLinkGPU} || BuildError;
|
||||||
pub fn link(b: *Builder, step: *std.build.LibExeObjStep, options: Options) LinkError!void {
|
pub fn link(b: *Builder, step: *std.build.LibExeObjStep, options: Options) LinkError!void {
|
||||||
cimportWorkaround();
|
|
||||||
|
|
||||||
const lib = try buildLibrary(b, step.build_mode, step.target, options);
|
const lib = try buildLibrary(b, step.build_mode, step.target, options);
|
||||||
step.linkLibrary(lib);
|
step.linkLibrary(lib);
|
||||||
addGLFWIncludes(step);
|
addGLFWIncludes(step);
|
||||||
|
|
Loading…
Add table
Reference in a new issue