static link

This commit is contained in:
David Allemang
2024-07-03 13:13:19 -04:00
parent d6fb485601
commit 1c54bdb1ad
2 changed files with 1 additions and 4 deletions

View File

@@ -30,8 +30,6 @@ pub fn build(b: *std.Build) void {
shaders.add("triangle_frag", "src/shaders/triangle.frag", .{});
exe.root_module.addImport("shaders", shaders.getModule());
// this requires PKG_CONFIG_PATH to be set. something like:
// ~/.local/lib/pkgconfig/
exe.linkSystemLibrary2("glfw3", .{
.needed = true,
.preferred_link_mode = .static,

View File

@@ -43,7 +43,7 @@ pub fn build(b: *std.Build) !void {
_ = copy.addCopyFile(cimgui_dep.path("cimgui.cpp"), "cimgui.cpp");
_ = copy.addCopyFile(cimgui_dep.path("generator/output/cimgui_impl.h"), "cimgui_impl.h");
const cimgui = b.addSharedLibrary(.{
const cimgui = b.addStaticLibrary(.{
.name = "cimgui",
.target = target,
.optimize = optimize,
@@ -75,7 +75,6 @@ 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,