Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
fel1x-developer committed Jan 15, 2025
1 parent b3dbc14 commit 91874f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,12 @@ const WindowsShim = struct {
.link_libc = false,
});

const options = b.addOptions();
options.addOption(bool, "is_standalone", true);

exe.root_module.addOptions("windows_shim", options);
dbg.root_module.addOptions("windows_shim", options);

return .{ .exe = exe, .dbg = dbg };
}
};
2 changes: 1 addition & 1 deletion src/install/windows-shim/bun_shim_impl.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const w = std.os.windows;
const assert = std.debug.assert;
const fmt16 = std.unicode.fmtUtf16le;

const is_standalone = !@hasDecl(@import("root"), "JavaScriptCore");
const is_standalone = !@hasDecl(@import("windows_shim"), "is_standalone");
const bun = if (!is_standalone) @import("root").bun else @compileError("cannot use 'bun' in standalone build of bun_shim_impl");
const bunDebugMessage = bun.Output.scoped(.bun_shim_impl, true);
const callmod_inline = if (is_standalone) std.builtin.CallModifier.always_inline else bun.callmod_inline;
Expand Down

0 comments on commit 91874f0

Please sign in to comment.