Cleanup and fix -D for erl_opts

This commit is contained in:
Tuncer Ayaz 2011-10-23 01:12:19 +02:00
parent a0dcc624d9
commit 8eeca123e5

View file

@ -166,13 +166,13 @@ doterl_compile(Config, OutDir, MoreSources) ->
erl_opts(Config) ->
RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []),
GlobalDefines = lists:map(fun(D) -> list_to_atom(D) end,
rebar_config:get_global(defines, [])),
GlobalDefines = [{d, list_to_atom(D)} ||
D <- rebar_config:get_global(defines, [])],
Opts = GlobalDefines ++ RawErlOpts,
case proplists:is_defined(no_debug_info, Opts) of
true ->
[O || O <- Opts, O =/= no_debug_info];
_ ->
false ->
[debug_info|Opts]
end.