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