mirror of
https://git.robbyzambito.me/zaprus/
synced 2026-02-04 03:34:48 +00:00
Add C API
This commit is contained in:
17
build.zig
17
build.zig
@@ -41,6 +41,23 @@ pub fn build(b: *std.Build) void {
|
||||
.target = target,
|
||||
});
|
||||
|
||||
// Create static library
|
||||
const lib = b.addLibrary(.{
|
||||
.name = "zaprus",
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/c_api.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.link_libc = true,
|
||||
.imports = &.{
|
||||
.{ .name = "zaprus", .module = mod },
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
b.installArtifact(lib);
|
||||
lib.installHeader(b.path("include/zaprus.h"), "zaprus.h");
|
||||
|
||||
// Here we define an executable. An executable needs to have a root module
|
||||
// which needs to expose a `main` function. While we could add a main function
|
||||
// to the module defined above, it's sometimes preferable to split business
|
||||
|
||||
Reference in New Issue
Block a user