static link
This commit is contained in:
@@ -30,8 +30,6 @@ pub fn build(b: *std.Build) void {
|
|||||||
shaders.add("triangle_frag", "src/shaders/triangle.frag", .{});
|
shaders.add("triangle_frag", "src/shaders/triangle.frag", .{});
|
||||||
exe.root_module.addImport("shaders", shaders.getModule());
|
exe.root_module.addImport("shaders", shaders.getModule());
|
||||||
|
|
||||||
// this requires PKG_CONFIG_PATH to be set. something like:
|
|
||||||
// ~/.local/lib/pkgconfig/
|
|
||||||
exe.linkSystemLibrary2("glfw3", .{
|
exe.linkSystemLibrary2("glfw3", .{
|
||||||
.needed = true,
|
.needed = true,
|
||||||
.preferred_link_mode = .static,
|
.preferred_link_mode = .static,
|
||||||
|
@@ -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("cimgui.cpp"), "cimgui.cpp");
|
||||||
_ = copy.addCopyFile(cimgui_dep.path("generator/output/cimgui_impl.h"), "cimgui_impl.h");
|
_ = copy.addCopyFile(cimgui_dep.path("generator/output/cimgui_impl.h"), "cimgui_impl.h");
|
||||||
|
|
||||||
const cimgui = b.addSharedLibrary(.{
|
const cimgui = b.addStaticLibrary(.{
|
||||||
.name = "cimgui",
|
.name = "cimgui",
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.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.h"), "cimgui.h");
|
||||||
cimgui.installHeader(copy.getDirectory().path(b, "cimgui_impl.h"), "cimgui_impl.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", .{
|
cimgui.linkSystemLibrary2("glfw3", .{
|
||||||
.needed = true,
|
.needed = true,
|
||||||
.preferred_link_mode = .static,
|
.preferred_link_mode = .static,
|
||||||
|
Reference in New Issue
Block a user