glfw: build windows sources
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
12321d89df
commit
2d98b0d382
1 changed files with 29 additions and 9 deletions
|
@ -36,14 +36,31 @@ pub fn link(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void
|
||||||
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
|
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
|
||||||
switch (target.os.tag) {
|
switch (target.os.tag) {
|
||||||
.windows => {
|
.windows => {
|
||||||
// TODO(slimsag): implement
|
var sources = std.ArrayList([]const u8).init(&arena.allocator);
|
||||||
// upstream/glfw/src/win32_thread.c
|
for ([_][]const u8{
|
||||||
// upstream/glfw/src/wgl_context.c
|
// Windows-specific sources
|
||||||
// upstream/glfw/src/win32_init.c
|
"upstream/glfw/src/win32_thread.c",
|
||||||
// upstream/glfw/src/win32_monitor.c
|
"upstream/glfw/src/wgl_context.c",
|
||||||
// upstream/glfw/src/win32_time.c
|
"upstream/glfw/src/win32_init.c",
|
||||||
// upstream/glfw/src/win32_joystick.c
|
"upstream/glfw/src/win32_monitor.c",
|
||||||
// upstream/glfw/src/win32_window.c
|
"upstream/glfw/src/win32_time.c",
|
||||||
|
"upstream/glfw/src/win32_joystick.c",
|
||||||
|
"upstream/glfw/src/win32_window.c",
|
||||||
|
|
||||||
|
// General sources
|
||||||
|
"upstream/glfw/src/monitor.c",
|
||||||
|
"upstream/glfw/src/init.c",
|
||||||
|
"upstream/glfw/src/vulkan.c",
|
||||||
|
"upstream/glfw/src/input.c",
|
||||||
|
"upstream/glfw/src/osmesa_context.c",
|
||||||
|
"upstream/glfw/src/egl_context.c",
|
||||||
|
"upstream/glfw/src/context.c",
|
||||||
|
"upstream/glfw/src/window.c",
|
||||||
|
}) |path| {
|
||||||
|
var abs_path = std.fs.path.join(&arena.allocator, &.{ thisDir(), path }) catch unreachable;
|
||||||
|
sources.append(abs_path) catch unreachable;
|
||||||
|
}
|
||||||
|
lib.addCSourceFiles(sources.items, &.{});
|
||||||
},
|
},
|
||||||
.macos => {
|
.macos => {
|
||||||
var sources = std.ArrayList([]const u8).init(&arena.allocator);
|
var sources = std.ArrayList([]const u8).init(&arena.allocator);
|
||||||
|
@ -106,7 +123,9 @@ fn linkGLFW(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void
|
||||||
|
|
||||||
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
|
const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target;
|
||||||
switch (target.os.tag) {
|
switch (target.os.tag) {
|
||||||
.windows => {},
|
.windows => {
|
||||||
|
// TODO(slimsag): create sdk-windows
|
||||||
|
},
|
||||||
.macos => {
|
.macos => {
|
||||||
const sdk_root_dir = getSdkRoot(b.allocator, "sdk-macos-11.3") catch unreachable;
|
const sdk_root_dir = getSdkRoot(b.allocator, "sdk-macos-11.3") catch unreachable;
|
||||||
defer b.allocator.free(sdk_root_dir);
|
defer b.allocator.free(sdk_root_dir);
|
||||||
|
@ -128,6 +147,7 @@ fn linkGLFW(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
// Assume Linux-like
|
// Assume Linux-like
|
||||||
|
// TODO(slimsag): create sdk-linux
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue