mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Compile contributed module with lager if enabled in ejabberd
This commit is contained in:
parent
f77622067b
commit
c9b82ff1e5
@ -443,9 +443,14 @@ compile(_Module, _Spec, DestDir) ->
|
|||||||
filelib:ensure_dir(filename:join(Ebin, ".")),
|
filelib:ensure_dir(filename:join(Ebin, ".")),
|
||||||
EjabBin = filename:dirname(code:which(ejabberd)),
|
EjabBin = filename:dirname(code:which(ejabberd)),
|
||||||
EjabInc = filename:join(filename:dirname(EjabBin), "include"),
|
EjabInc = filename:join(filename:dirname(EjabBin), "include"),
|
||||||
|
Logger = case code:is_loaded(lager) of
|
||||||
|
{file, _} -> [{d, 'LAGER'}];
|
||||||
|
_ -> []
|
||||||
|
end,
|
||||||
Options = [{outdir, Ebin}, {i, "include"}, {i, EjabInc},
|
Options = [{outdir, Ebin}, {i, "include"}, {i, EjabInc},
|
||||||
{d, 'NO_EXT_LIB'}, %% use include instead of include_lib
|
{d, 'NO_EXT_LIB'}, %% use include instead of include_lib
|
||||||
verbose, report_errors, report_warnings],
|
verbose, report_errors, report_warnings]
|
||||||
|
++ Logger,
|
||||||
Result = [case compile:file(File, Options) of
|
Result = [case compile:file(File, Options) of
|
||||||
{ok, _} -> ok;
|
{ok, _} -> ok;
|
||||||
{ok, _, _} -> ok;
|
{ok, _, _} -> ok;
|
||||||
|
Loading…
Reference in New Issue
Block a user