oh moving things to bh

This commit is contained in:
peterino2 2025-11-09 20:06:12 -08:00
parent fdb23323fe
commit 13d73418f8
9 changed files with 18 additions and 26 deletions

5
lib/bh/build.zig vendored
View File

@ -8,6 +8,11 @@ pub const ModLib = struct {
pub fn install(self: @This()) void {
self.b.installArtifact(self.lib);
}
pub fn addIncludePath(self: @This(), path: []const u8) void {
self.lib.addIncludePath(self.b.path(path));
self.mod.addIncludePath(self.b.path(path));
}
};
pub const ModLibOptions = struct {

View File

@ -16,9 +16,9 @@ pub fn build(b: *std.Build) void {
cimgui.install();
cimgui.mod.addIncludePath(b.path("cimgui/imgui"));
cimgui.mod.addIncludePath(b.path("cimgui/SDL/include"));
cimgui.mod.addIncludePath(b.path("cimplot"));
cimgui.mod.addIncludePath(b.path("cimgui/imgui"));
cimgui.mod.addIncludePath(b.path("cimplot/implot"));
cimgui.lib.linkLibC();

View File

@ -1,5 +1,3 @@
const cimgui = @import("cimgui");
test "huh" {
cimgui.initialize();
}
test "huh" {}

6
lib/enet/build.zig vendored
View File

@ -43,8 +43,7 @@ pub fn build(b: *std.Build) void {
},
.flags = &.{"-DHAS_OFFSETOF=1"},
});
enet.lib.addIncludePath(b.path("enet-1.3.18/include"));
enet.addIncludePath("enet-1.3.18/include");
// Platform-specific configuration
switch (target.result.os.tag) {
@ -59,8 +58,6 @@ pub fn build(b: *std.Build) void {
else => {},
}
enet.mod.addIncludePath(b.path("enet-1.3.18/include/"));
const test_step = b.step("test", "run unit tests for enet");
const tests = b.addTest(.{
.root_module = b.createModule(.{
@ -71,6 +68,7 @@ pub fn build(b: *std.Build) void {
}),
});
tests.linkLibrary(enet.lib);
tests.root_module.addImport("enet", enet.mod);
tests.root_module.addIncludePath(b.path("enet-1.3.18/include/"));
const runArtifact = b.addRunArtifact(tests);

8
lib/lua/build.zig vendored
View File

@ -17,15 +17,11 @@ pub fn build(b: *std.Build) void {
lua.install();
// Add include paths to module (for Zig @cImport)
lua.mod.addIncludePath(b.path("lua/src/"));
lua.mod.addIncludePath(b.path("src/"));
lua.addIncludePath("lua/src/");
lua.addIncludePath("src/");
// Configure library
lua.lib.linkLibC();
lua.lib.addIncludePath(b.path("lua/src/"));
lua.lib.addIncludePath(b.path("src/"));
lua.lib.addCSourceFiles(.{
.root = b.path("lua/src/"),
.files = &.{

View File

@ -17,12 +17,11 @@ pub fn build(b: *std.Build) void {
miniaudio.install();
// Add include paths to module (for Zig @cImport)
miniaudio.mod.addIncludePath(b.path("./include"));
miniaudio.addIncludePath("./include");
// Configure library
miniaudio.lib.linkLibC();
miniaudio.lib.addIncludePath(b.path("include"));
miniaudio.lib.addCSourceFile(.{ .file = b.path("src/miniaudio.cpp"), .flags = &.{"-fno-sanitize=all"}, .language = .c });
// ======== tests ============

4
lib/nfd/build.zig vendored
View File

@ -17,12 +17,10 @@ pub fn build(b: *std.Build) void {
nfd.install();
// Add include paths to module (for Zig @cImport)
nfd.mod.addIncludePath(b.path("include"));
nfd.addIncludePath("include");
// Configure library
nfd.lib.linkLibC();
nfd.lib.addIncludePath(b.path("include"));
nfd.lib.addCSourceFile(.{
.file = b.path("src/nfd_common.c"),
.flags = &.{},

2
lib/ozz/build.zig vendored
View File

@ -148,7 +148,7 @@ pub fn build(b: *std.Build) void {
const ozz_cpp = b.addLibrary(.{
.linkage = if (static_build) .static else .dynamic,
.name = "ozz_cpp",
.name = "ozz",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,

10
lib/spng/build.zig vendored
View File

@ -17,16 +17,12 @@ pub fn build(b: *std.Build) void {
spng.install();
// Add include paths to module (for Zig @cImport)
spng.mod.addIncludePath(b.path("spng"));
spng.mod.addIncludePath(b.path("./"));
spng.addIncludePath("spng");
spng.addIncludePath("./");
// Configure library
spng.lib.linkLibC();
spng.lib.addIncludePath(b.path("spng"));
spng.lib.addIncludePath(b.path("./"));
spng.lib.addCSourceFile(.{ .file = b.path("spng/spng.c") });
spng.lib.addCSourceFile(.{ .file = b.path("miniz.c") });
@ -43,8 +39,10 @@ pub fn build(b: *std.Build) void {
});
tests.root_module.addImport("spng", spng.mod);
tests.root_module.linkLibrary(spng.lib);
tests.root_module.addIncludePath(b.path("spng"));
tests.root_module.addIncludePath(b.path("./"));
const runArtifact = b.addRunArtifact(tests);
test_step.dependOn(&runArtifact.step);
}