25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-31 15:21:38 +01:00
xmpp.chapril.org-ejabberd/plugins/deps_erl_opts.erl
Paweł Chmielowski bae333788b Add plugin for passing extra erl_opts flags to deps, and use it for hipe
This fixes #425 in github issue tracker
2015-12-16 12:23:13 +01:00

13 lines
548 B
Erlang

-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), []}.