We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea68588 commit a191345Copy full SHA for a191345
build.zig
@@ -21,7 +21,14 @@ pub fn build(b: *std.Build) void {
21
.target = target,
22
.optimize = optimize,
23
});
24
- lib.linkLibC();
+ const cjni = b.addTranslateC(.{
25
+ .root_source_file = b.path("src/include/jni/jni.h"),
26
+ .target = target,
27
+ .optimize = optimize,
28
+ .link_libc = true,
29
+ });
30
+ lib.root_module.addImport("cjni", cjni.createModule());
31
+
32
lib.addIncludePath(.{ .src_path = .{
33
.owner = b,
34
.sub_path = "src/include/jni",
src/main/zig/lib.zig
@@ -1,8 +1,6 @@
1
const std = @import("std");
2
3
-pub const cjni = @cImport({
4
- @cInclude("jni.h");
5
-});
+pub const cjni = @import("cjni");
6
7
pub const cEnv = cjni.JNIEnv;
8
0 commit comments