From d24021f4e391f0ad7e749a5106d00ea6a404557b Mon Sep 17 00:00:00 2001 From: Joseph Wayne Norton Date: Tue, 30 Nov 2010 00:00:02 +0100 Subject: [PATCH] Add new global flag 'debug_info' to erlc_compiler Using rebar's commandline, enable/disable 'debug_info' for compilation. This feature if added to all rebar compilers could help simplify and standardize this common use case for all rebar build targets. --- src/rebar_erlc_compiler.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index e872e2b..ef56bf4 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -99,7 +99,14 @@ doterl_compile(Config, OutDir) -> doterl_compile(Config, OutDir, MoreSources) -> FirstErls = rebar_config:get_list(Config, erl_first_files, []), - ErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []), + RawErlOpts = filter_defines(rebar_config:get(Config, erl_opts, []), []), + ErlOpts = + case rebar_config:get_global(debug_info, "0") of + "0" -> + RawErlOpts; + _ -> + [debug_info|RawErlOpts] + end, ?DEBUG("erl_opts ~p~n",[ErlOpts]), %% Support the src_dirs option allowing multiple directories to %% contain erlang source. This might be used, for example, should