Skip to content

Commit

Permalink
Set up musl support
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtaylor committed Mar 6, 2024
1 parent 397b4ce commit c738c80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/h3_geo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ defmodule H3Geo do
crate: :h3geo,
base_url: "https://github.com/breakroom/h3geo/releases/download/v#{version}",
force_build: System.get_env("H3GEO_BUILD") in ["1", "true"],
targets:
Enum.uniq(["aarch64-unknown-linux-musl" | RustlerPrecompiled.Config.default_targets()]),
version: version

@doc """
Expand Down
13 changes: 9 additions & 4 deletions native/h3geo/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[target.'cfg(target_os = "macos")']
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]

# See https://github.com/rust-lang/rust/issues/59302
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]

# Provides a small build size, but takes more time to build.
[profile.release]
lto = true

0 comments on commit c738c80

Please sign in to comment.