mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Add plugin for passing extra erl_opts flags to deps, and use it for hipe
This fixes #425 in github issue tracker
This commit is contained in:
parent
5fd1aa0d04
commit
bae333788b
12
plugins/deps_erl_opts.erl
Normal file
12
plugins/deps_erl_opts.erl
Normal file
@ -0,0 +1,12 @@
|
||||
-module(deps_erl_opts).
|
||||
-export([preprocess/2]).
|
||||
|
||||
preprocess(Config, Dirs) ->
|
||||
ExtraOpts = rebar_config:get(Config, deps_erl_opts, []),
|
||||
Opts = rebar_config:get(Config, erl_opts, []),
|
||||
NewOpts = lists:foldl(fun(Opt, Acc) when is_tuple(Opt) ->
|
||||
lists:keystore(element(1, Opt), 1, Acc, Opt);
|
||||
(Opt, Acc) ->
|
||||
[Opt | lists:delete(Opt, Acc)]
|
||||
end, Opts, ExtraOpts),
|
||||
{ok, rebar_config:set(Config, erl_opts, NewOpts), []}.
|
@ -157,10 +157,10 @@ CfgXrefs = lists:flatmap(
|
||||
|
||||
ElixirConfig = case lists:keysearch(elixir, 1, Cfg) of
|
||||
{value, {elixir, true}} ->
|
||||
[{plugins, [rebar_elixir_compiler, rebar_exunit] },
|
||||
[{plugins, [deps_erl_opts, rebar_elixir_compiler, rebar_exunit] },
|
||||
{lib_dirs, ["deps/elixir/lib"]}];
|
||||
_ ->
|
||||
[]
|
||||
[{plugins, [deps_erl_opts]}]
|
||||
end,
|
||||
|
||||
{ok, Cwd} = file:get_cwd(),
|
||||
@ -181,6 +181,7 @@ AllDeps = case lists:keytake(lager, 1, AllDeps0) of
|
||||
|
||||
Config = [{erl_opts, Macros ++ HiPE ++ DebugInfo ++
|
||||
[{src_dirs, [asn1, src | SrcDirs]}]},
|
||||
{deps_erl_opts, HiPE},
|
||||
{sub_dirs, ["rel"]},
|
||||
{keep_build_info, true},
|
||||
{ct_extra_params, "-ct_hooks cth_surefire "
|
||||
|
Loading…
Reference in New Issue
Block a user