Skip to content

Commit 774d2c1

Browse files
committed
Various small fixes
Allows our project to build with the upgraded zigler
1 parent 642217f commit 774d2c1

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

lib/zig/_c.ex

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ defmodule Zig.C do
5151
defp solve_relative({:system, _} = system, _), do: system
5252

5353
defp solve_relative(file, module_file) do
54-
module_file
55-
|> Path.dirname()
56-
|> Path.join(file)
57-
|> Path.expand()
54+
Path.expand(file, module_file)
5855
end
5956

6057
defp normalize_src(file, module_file) when is_binary(file) do

lib/zig/templates/build.zig.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn build(b: *std.Build) void {
7474
<% {:system, lib} -> %>
7575
nif.linkSystemLibrary("<%= lib %>", .{});
7676
<% lib -> %>
77-
nif.addObjectFile("<%= lib %>");
77+
nif.addObjectFile(.{.cwd_relative = "<%= lib %>"});
7878
<% end %>
7979
<% end %>
8080
<% end %>

mix.exs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ defmodule Zigler.MixProject do
4646
end
4747

4848
defp guides() do
49-
"guides"
50-
|> File.ls!()
51-
|> Enum.sort()
52-
|> Enum.filter(&String.ends_with?(&1, ".md"))
53-
|> Enum.map(&Path.join("guides", &1))
49+
"guides/*.md"
50+
|> Path.wildcard()
51+
|> Enum.map(&Path.join("guides", Path.basename(&1, ".md")))
5452
end
5553

5654
def application, do: [extra_applications: [:logger, :inets, :crypto, :public_key, :ssl]]

0 commit comments

Comments
 (0)