diff --git a/lib/h3_geo.ex b/lib/h3_geo.ex index 1235385..4e42c19 100644 --- a/lib/h3_geo.ex +++ b/lib/h3_geo.ex @@ -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 """ diff --git a/native/h3geo/.cargo/config.toml b/native/h3geo/.cargo/config.toml index 20f03f3..fe3ae51 100644 --- a/native/h3geo/.cargo/config.toml +++ b/native/h3geo/.cargo/config.toml @@ -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