I am trying to create a simple graphics library using OpenGL
what i want to do is to try to use this library in my other projects however some info online is quite outdated so i am not rly able to get this running
my library
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const lib = b.addStaticLibrary(.{
.name = "maskot",
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
b.installArtifact(lib);
const run_cmd = b.addRunArtifact(lib);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
lib.linkLibC();
lib.addIncludePath(b.path("src/vendors"));
lib.addCSourceFiles(.{ .root = b.path("src/vendors"), .files = &.{"glad.c"} });
lib.linkSystemLibrary("gl");
lib.linkSystemLibrary("glfw");
}
root.zig
pub const window = @import("window.zig");
pub const shader = @import("shader.zig");
pub const shape = @import("shape.zig");
other project
exe.linkLibC();
const maskot_lib = b.addStaticLibrary(.{
.name = "maskot",
.root_source_file = b.path("../maskot/src/root.zig"),
.target = target,
.optimize = optimize,
.use_llvm = false,
.use_lld = false,
});
exe.linkLibrary(maskot_lib);
exe.linkSystemLibrary("gl");
exe.linkSystemLibrary("glfw");
b.installArtifact(exe);
}
const maskot = @import("maskot");
this doesnt work