Skip to content

Commit

Permalink
Make debug_info default
Browse files Browse the repository at this point in the history
Add no_debug_info option.
Remove debug_info=1 option.
  • Loading branch information
Tuncer Ayaz committed Mar 30, 2011
1 parent 6d75bfb commit be209f2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions priv/shell-completion/bash/rebar
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ _rebar()
cmdsnvars="build-plt check-plt check-deps clean compile \
create create-app create-node ct dialyze doc delete-deps eunit \
get-deps generate generate-upgrade help list-templates update-deps \
version xref case= debug_info=1 force=1 jobs= suite= verbose=1 \
appid= previous_release= skip_deps=1 template= template_dir="
version xref case= force=1 jobs= suite= verbose=1 appid= \
previous_release= skip_deps=1 template= template_dir="

if [[ ${cur} == --* ]] ; then
COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{app_bin, ["priv/rebar"]}.
{erl_opts, [fail_on_warning, debug_info]}.
{erl_opts, [fail_on_warning]}.
{xref_checks, [undefined_function_calls]}.
2 changes: 1 addition & 1 deletion rebar.config.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{erl_first_files, ["mymib1", "mymib2"]}.

%% Erlang compiler options
{erl_opts, [{i, "myinclude"}, {src_dirs, ["src1", "src2"]},
{erl_opts, [no_debug_info, {i, "myinclude"}, {src_dirs, ["src1", "src2"]},
{platform_define,
"(linux|solaris|freebsd|darwin)", 'HAVE_SENDFILE'},
{platform_define, "(linux|freebsd)", 'BACKLOG', 128},
Expand Down
13 changes: 6 additions & 7 deletions src/rebar_erlc_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@ doterl_compile(Config, OutDir) ->
doterl_compile(Config, OutDir, MoreSources) ->
FirstErls = rebar_config:get_list(Config, erl_first_files, []),
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,
ErlOpts = case proplists:is_defined(no_debug_info, RawErlOpts) of
true ->
[O || O <- RawErlOpts, O =/= no_debug_info];
_ ->
[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
Expand Down
4 changes: 2 additions & 2 deletions src/rebar_eunit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ eunit_config(Config) ->

ErlOpts = rebar_config:get_list(Config, erl_opts, []),
EunitOpts = rebar_config:get_list(Config, eunit_compile_opts, []),
Opts = [{d, 'TEST'}, debug_info] ++
Opts0 = [{d, 'TEST'}] ++
ErlOpts ++ EunitOpts ++ EqcOpts ++ PropErOpts,
Opts = [O || O <- Opts0, O =/= no_debug_info],
Config1 = rebar_config:set(Config, erl_opts, Opts),

FirstErls = rebar_config:get_list(Config1, eunit_first_files, []),
rebar_config:set(Config1, erl_first_files, FirstErls).


eqc_opts() ->
define_if('EQC', is_lib_avail(is_eqc_avail, eqc,
"eqc.hrl", "QuickCheck")).
Expand Down

0 comments on commit be209f2

Please sign in to comment.