Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recompile if the NIF library is changed/deleted #624

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rustler_mix/lib/rustler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ defmodule Rustler do
end

if config.lib do
{otp_app, path} = config.load_from

@external_resource Application.app_dir(
otp_app,
"#{path}.#{Rustler.Compiler.get_lib_suffix()}"
)

@load_from config.load_from
@load_data config.load_data
@load_data_fun config.load_data_fun
Expand Down
2 changes: 2 additions & 0 deletions rustler_mix/lib/rustler/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ defmodule Rustler.Compiler do
end
end

def get_lib_suffix(), do: get_suffix(nil, :lib)

defp get_suffix(target, :lib) do
case get_target_os_type(target) do
{:win32, _} -> "dll"
Expand Down
Loading