diff options
author | Luis Rascao <luis.rascao@miniclip.com> | 2016-01-26 00:30:56 +0000 |
---|---|---|
committer | Luis Rascao <luis.rascao@miniclip.com> | 2016-01-26 18:53:36 +0000 |
commit | 123630a68eef89be63b6ffca1a4cbb21e76a2625 (patch) | |
tree | 4278ffb2b68c4d96bd48a58ec80d27a69855e6cf /src | |
parent | 084fd3116a9e783e061184a768fd4eec9b255582 (diff) |
Add module directory to include path
Several projects use an include path relative
to the project's root.
file:compile will look in three places for the include
files:
The current working directory
The directory where the module is being compiled
The directories given by the include option
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_erlc_compiler.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 162ed07..3480cf6 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -304,7 +304,8 @@ needed_files(G, ErlOpts, Dir, OutDir, SourceFiles) -> TargetBase = target_base(OutDir, Source), Target = TargetBase ++ ".beam", AllOpts = [{outdir, filename:dirname(Target)} - ,{i, filename:join(Dir, "include")}] ++ ErlOpts, + ,{i, filename:join(Dir, "include")} + ,{i, Dir}] ++ ErlOpts, digraph:vertex(G, Source) > {Source, filelib:last_modified(Target)} orelse opts_changed(AllOpts, TargetBase) end, SourceFiles). @@ -503,7 +504,7 @@ internal_erl_compile(_Opts, Dir, Module, OutDir, ErlOpts) -> Target = target_base(OutDir, Module) ++ ".beam", ok = filelib:ensure_dir(Target), AllOpts = [{outdir, filename:dirname(Target)}] ++ ErlOpts ++ - [{i, filename:join(Dir, "include")}, return], + [{i, filename:join(Dir, "include")}, {i, Dir}, return], case compile:file(Module, AllOpts) of {ok, _Mod} -> ok; |