mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Use compilation flags used during build to compile modules in ext_mod
This fixes issue #3178
This commit is contained in:
parent
df47e2a93f
commit
151b818af4
19
mix.exs
19
mix.exs
@ -51,12 +51,25 @@ defmodule Ejabberd.Mixfile do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp if_version_below(ver, okResult) do
|
||||||
|
if :erlang.system_info(:otp_release) < ver do
|
||||||
|
okResult
|
||||||
|
else
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
defp erlc_options do
|
defp erlc_options do
|
||||||
# Use our own includes + includes from all dependencies
|
# Use our own includes + includes from all dependencies
|
||||||
includes = ["include"] ++ deps_include(["fast_xml", "xmpp", "p1_utils"])
|
includes = ["include"] ++ deps_include(["fast_xml", "xmpp", "p1_utils"])
|
||||||
[:debug_info, {:d, :ELIXIR_ENABLED}] ++ cond_options() ++ Enum.map(includes, fn(path) -> {:i, path} end) ++
|
result = [:debug_info, {:d, :ELIXIR_ENABLED}] ++
|
||||||
if_version_above('20', [{:d, :DEPRECATED_GET_STACKTRACE}]) ++
|
cond_options() ++
|
||||||
if_function_exported(:erl_error, :format_exception, 6, [{:d, :HAVE_ERL_ERROR}])
|
Enum.map(includes, fn (path) -> {:i, path} end) ++
|
||||||
|
if_version_above('20', [{:d, :DEPRECATED_GET_STACKTRACE}]) ++
|
||||||
|
if_version_below('22', [{:d, :LAGER}]) ++
|
||||||
|
if_function_exported(:erl_error, :format_exception, 6, [{:d, :HAVE_ERL_ERROR}])
|
||||||
|
defines = for {:d, value} <- result, do: {:d, value}
|
||||||
|
result ++ [{:d, :ALL_DEFS, defines}]
|
||||||
end
|
end
|
||||||
|
|
||||||
defp cond_options do
|
defp cond_options do
|
||||||
|
@ -304,12 +304,14 @@ fun(Hooks) ->
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
ProcessErlOpt = fun(Vals) ->
|
ProcessErlOpt = fun(Vals) ->
|
||||||
lists:map(
|
R = lists:map(
|
||||||
fun({i, Path}) ->
|
fun({i, Path}) ->
|
||||||
{i, ResolveDepPath(Path)};
|
{i, ResolveDepPath(Path)};
|
||||||
(ErlOpt) ->
|
(ErlOpt) ->
|
||||||
ErlOpt
|
ErlOpt
|
||||||
end, Vals)
|
end, Vals),
|
||||||
|
M = lists:filter(fun({d, M}) -> true; (_) -> false end, R),
|
||||||
|
[{d, 'ALL_DEFS', M} | R]
|
||||||
end,
|
end,
|
||||||
|
|
||||||
ProcssXrefExclusions = fun(Items) ->
|
ProcssXrefExclusions = fun(Items) ->
|
||||||
|
@ -570,7 +570,7 @@ compile_result(Results) ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
compile_options() ->
|
compile_options() ->
|
||||||
[verbose, report_errors, report_warnings]
|
[verbose, report_errors, report_warnings, ?ALL_DEFS]
|
||||||
++ [{i, filename:join(app_dir(App), "include")}
|
++ [{i, filename:join(app_dir(App), "include")}
|
||||||
|| App <- [fast_xml, xmpp, p1_utils, ejabberd]]
|
|| App <- [fast_xml, xmpp, p1_utils, ejabberd]]
|
||||||
++ [{i, filename:join(mod_dir(Mod), "include")}
|
++ [{i, filename:join(mod_dir(Mod), "include")}
|
||||||
|
Loading…
Reference in New Issue
Block a user