build glfw

This commit is contained in:
David Allemang
2024-07-03 11:34:13 -04:00
parent 8a9bbee536
commit f0e7be542b
6 changed files with 115 additions and 71 deletions

View File

@@ -1,5 +1,6 @@
const std = @import("std");
const vkgen = @import("vulkan-zig");
const glfw_util = @import("glfw");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
@@ -7,6 +8,7 @@ pub fn build(b: *std.Build) !void {
const imgui_dep = b.dependency("imgui", .{});
const cimgui_dep = b.dependency("cimgui", .{});
const glfw_dep = b.dependency("glfw", .{});
const luajit = try b.findProgram(&.{"luajit"}, &.{});
@@ -74,13 +76,7 @@ pub fn build(b: *std.Build) !void {
});
cimgui.installHeader(copy.getDirectory().path(b, "cimgui.h"), "cimgui.h");
cimgui.installHeader(copy.getDirectory().path(b, "cimgui_impl.h"), "cimgui_impl.h");
// todo separate impls into different shared libraries for easier linkage
cimgui.linkSystemLibrary2("glfw3", .{
.needed = true,
.preferred_link_mode = .static,
.use_pkg_config = .force,
});
glfw_util.link(glfw_dep, cimgui);
b.installArtifact(cimgui);