Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Zig 0.13 #25

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Zig
uses: goto-bus-stop/setup-zig@v1
with:
version: 0.12.0
version: 0.13.0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Restore dependencies cache
uses: actions/cache@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ kinda-*.tar
.elixir_ls
/kinda_example/mix.lock
zig-cache
.zig-cache
6 changes: 3 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ const std = @import("std");
pub fn build(b: *std.Build) !void {
const erl_nif = b.addModule(
"erl_nif",
.{ .root_source_file = .{ .path = "src/erl_nif.zig" } },
.{ .root_source_file = b.path("src/erl_nif.zig") },
);
const beam = b.addModule(
"beam",
.{ .root_source_file = .{ .path = "src/beam.zig" } },
.{ .root_source_file = b.path("src/beam.zig") },
);
beam.addImport("erl_nif", erl_nif);
const kinda = b.addModule(
"kinda",
.{ .root_source_file = .{ .path = "src/kinda.zig" } },
.{ .root_source_file = b.path("src/kinda.zig") },
);
kinda.addImport("erl_nif", erl_nif);
kinda.addImport("beam", beam);
Expand Down
6 changes: 3 additions & 3 deletions kinda_example/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const lib = b.addSharedLibrary(.{
.name = "KindaExampleNIF",
.root_source_file = .{ .path = "native/zig-src/main.zig" },
.root_source_file = b.path("native/zig-src/main.zig"),
.optimize = .Debug,
.target = b.host,
});
Expand All @@ -16,9 +16,9 @@ pub fn build(b: *std.Build) void {
lib.root_module.addImport("erl_nif", kinda.module("erl_nif"));
lib.root_module.addImport("beam", kinda.module("beam"));
if (os.isDarwin()) {
lib.addRPath(.{ .path = "@loader_path" });
lib.root_module.addRPathSpecial("@loader_path");
} else {
lib.addRPath(.{ .path = ":$ORIGIN" });
lib.root_module.addRPathSpecial("$ORIGIN");
}
lib.linkSystemLibrary("KindaExample");
lib.linker_allow_shlib_undefined = true;
Expand Down
Loading