summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r--src/rebar_erlc_compiler.erl33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 38dd198..fe06cbf 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -52,7 +52,8 @@
%%
%% OtpRelease = erlang:system_info(otp_release).
%% SysArch = erlang:system_info(system_architecture).
-%% Words = integer_to_list(8 * erlang:system_info(wordsize)).
+%% Words = integer_to_list(8 *
+%% erlang:system_info({wordsize, external})).
%%
%% E.g. to define HAVE_SENDFILE only on systems with
%% sendfile(), to define BACKLOG on Linux/FreeBSD as 128,
@@ -69,9 +70,13 @@
-spec compile(Config::rebar_config:config(), AppFile::file:filename()) -> 'ok'.
compile(Config, _AppFile) ->
- ?DEPRECATED(fail_on_warning, warnings_as_errors,
- rebar_config:get_list(Config, erl_opts, []),
- "once OTP R14B03 is released"),
+ %% TODO: enable as soon as OTP patch has been accepted
+ %% ?DEPRECATED(fail_on_warning, warnings_as_errors,
+ %% rebar_config:get_list(Config, xrl_opts, []),
+ %% "once R15 is released"),
+ %% ?DEPRECATED(fail_on_warning, warnings_as_errors,
+ %% rebar_config:get_list(Config, yrl_opts, []),
+ %% "once R15 is released"),
rebar_base_compiler:run(Config,
check_files(rebar_config:get_local(
@@ -247,21 +252,10 @@ internal_erl_compile(Source, Config, Outdir, ErlOpts) ->
case needs_compile(Source, Target, Hrls) of
true ->
Opts = [{outdir, filename:dirname(Target)}] ++
- ErlOpts ++ [{i, "include"}, report, return],
+ ErlOpts ++ [{i, "include"}, report],
case compile:file(Source, Opts) of
- {ok, _, []} ->
+ {ok, _} ->
ok;
- {ok, _, _Warnings} ->
- %% We got at least one warning -- if fail_on_warning
- %% is in options, fail
- case lists:member(fail_on_warning, Opts) of
- true ->
- %% remove target to prevent overlooking this failure
- ok = file:delete(Target),
- ?FAIL;
- false ->
- ok
- end;
_ ->
?FAIL
end;
@@ -286,14 +280,14 @@ compile_mib(Source, Target, Config) ->
Config::rebar_config:config()) -> 'ok'.
compile_xrl(Source, Target, Config) ->
Opts = [{scannerfile, Target}, {return, true}
- |rebar_config:get(Config, xrl_opts, [])],
+ | rebar_config:get(Config, xrl_opts, [])],
compile_xrl_yrl(Source, Target, Opts, leex).
-spec compile_yrl(Source::file:filename(), Target::file:filename(),
Config::rebar_config:config()) -> 'ok'.
compile_yrl(Source, Target, Config) ->
Opts = [{parserfile, Target}, {return, true}
- |rebar_config:get(Config, yrl_opts, [])],
+ | rebar_config:get(Config, yrl_opts, [])],
compile_xrl_yrl(Source, Target, Opts, yecc).
-spec compile_xrl_yrl(Source::file:filename(), Target::file:filename(),
@@ -305,6 +299,7 @@ compile_xrl_yrl(Source, Target, Opts, Mod) ->
{ok, _, []} ->
ok;
{ok, _, _Warnings} ->
+ %% TODO: remove once R15 is released
case lists:member(fail_on_warning, Opts) of
true ->
?FAIL;