1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-06 03:50:15 +02:00

ext_mod: Support Elixir modules with several defimpl, like Decimal

This commit is contained in:
Badlop 2023-12-21 00:44:52 +01:00
parent 0121adec03
commit b08001183e

View file

@ -604,7 +604,7 @@ compile(LibDir) ->
|| File <- filelib:wildcard(Src++"/*.erl")], || File <- filelib:wildcard(Src++"/*.erl")],
Ex = [compile_elixir_file(Bin, File) Ex = [compile_elixir_file(Bin, File)
|| File <- filelib:wildcard(Lib ++ "/**/*.ex")], || File <- filelib:wildcard(Lib ++ "/**/*.ex")],
compile_result(Er++Ex). compile_result(lists:flatten([Er, Ex])).
compile_c_files(LibDir) -> compile_c_files(LibDir) ->
case file:read_file_info(filename:join(LibDir, "c_src/Makefile")) of case file:read_file_info(filename:join(LibDir, "c_src/Makefile")) of
@ -673,7 +673,7 @@ compile_elixir_file(Dest, File) when is_list(Dest) and is_list(File) ->
compile_elixir_file(Dest, File) -> compile_elixir_file(Dest, File) ->
try 'Elixir.Kernel.ParallelCompiler':files_to_path([File], Dest, []) of try 'Elixir.Kernel.ParallelCompiler':files_to_path([File], Dest, []) of
[Module] -> {ok, Module} Modules when is_list(Modules) -> {ok, Modules}
catch catch
_ -> {error, {compilation_failed, File}} _ -> {error, {compilation_failed, File}}
end. end.