Skip to content

Commit

Permalink
Various small fixes (#483)
Browse files Browse the repository at this point in the history
Allows our project to build with the upgraded zigler
  • Loading branch information
maennchen authored Aug 13, 2024
1 parent 68b6549 commit 2cbc6ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions lib/zig/_c.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ defmodule Zig.C do
defp solve_relative({:system, _} = system, _), do: system

defp solve_relative(file, module_file) do
module_file
|> Path.dirname()
|> Path.join(file)
|> Path.expand()
Path.expand(file, module_file)
end

defp normalize_src(file, module_file) when is_binary(file) do
Expand Down
2 changes: 1 addition & 1 deletion lib/zig/templates/build.zig.eex
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn build(b: *std.Build) void {
<% {:system, lib} -> %>
nif.linkSystemLibrary("<%= lib %>", .{});
<% lib -> %>
nif.addObjectFile("<%= lib %>");
nif.addObjectFile(.{.cwd_relative = "<%= lib %>"});
<% end %>
<% end %>
<% end %>
Expand Down
8 changes: 3 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ defmodule Zigler.MixProject do
end

defp guides() do
"guides"
|> File.ls!()
|> Enum.sort()
|> Enum.filter(&String.ends_with?(&1, ".md"))
|> Enum.map(&Path.join("guides", &1))
"guides/*.md"
|> Path.wildcard()
|> Enum.map(&Path.join("guides", Path.basename(&1, ".md")))
end

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

0 comments on commit 2cbc6ec

Please sign in to comment.