Skip to content

Commit 128ffdf

Browse files
authored
Specify targets in RustlerPrecompiled config (#5)
* specify targets * syntax
1 parent 0dfd799 commit 128ffdf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/exstatic/native.ex

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
defmodule Exstatic.Native do
22
@moduledoc false
3-
version = Mix.Project.config()[:version]
3+
config = Mix.Project.config()
44

55
use RustlerPrecompiled,
66
otp_app: :exstatic,
77
crate: "exstatic",
8-
base_url: "https://github.com/intellection/exstatic/releases/download/v#{version}",
8+
base_url: "#{config[:source_url]}/releases/download/v#{config[:version]}",
99
force_build: System.get_env("EXSTATIC_BUILD") == "true",
1010
nif_versions: ["2.16"],
11-
version: version
11+
version: config[:version],
12+
targets: ~w(
13+
aarch64-apple-darwin
14+
x86_64-apple-darwin
15+
aarch64-unknown-linux-gnu
16+
x86_64-unknown-linux-gnu
17+
)
1218

1319
@spec normal_pdf(float(), float(), float()) :: float()
1420
def normal_pdf(_mean, _std_dev, _x), do: :erlang.nif_error(:nif_not_loaded)

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Exstatic.MixProject do
22
use Mix.Project
33

4-
@version "0.1.0"
4+
@version "0.1.1"
55
@source_url "https://github.com/intellection/exstatic"
66

77
def project do

0 commit comments

Comments
 (0)