Skip to content

Commit

Permalink
Recompile if the NIF library is changed/deleted (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor authored Jun 24, 2024
1 parent acb19bd commit 7fef3c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit 7fef3c5

Please sign in to comment.