-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support elixir_make pre-compiler API
- Loading branch information
1 parent
01fc356
commit 6d03dc7
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule Kinda.Precompiler do | ||
@behaviour ElixirMake.Precompiler | ||
|
||
@impl true | ||
def current_target, do: RustlerPrecompiled.target() | ||
|
||
@impl true | ||
def all_supported_targets(_), do: ~w( | ||
aarch64-apple-darwin | ||
x86_64-unknown-linux-gnu | ||
) | ||
|
||
@impl true | ||
def build_native(args) do | ||
{:ok, t} = current_target() | ||
System.put_env("KINDA_NIF_TARGET", t) | ||
ElixirMake.Compiler.compile(args) | ||
end | ||
|
||
@impl true | ||
def precompile(args, _target) do | ||
ElixirMake.Compiler.compile(args) | ||
:ok | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters