diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2016-08-28 18:09:44 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2016-08-28 18:36:18 +0200 |
commit | 4b4d66cc640fa933be398b5dcde1e4aa51a98cc0 (patch) | |
tree | 5265ac0eb5066bd3059174c7f3e2e2f0ac457132 | |
parent | b709625adf7ca098ad87dad4af2d5f9fb024ac19 (diff) | |
download | rebar-4b4d66cc640fa933be398b5dcde1e4aa51a98cc0.tar.gz |
Fix cdb processing when a file is skipped
-rw-r--r-- | src/rebar_port_compiler.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl index 1119e4e..7aa04ec 100644 --- a/src/rebar_port_compiler.erl +++ b/src/rebar_port_compiler.erl @@ -244,15 +244,16 @@ compile_each(Config, [Source | Rest], Type, Env, {NewBins, CDB}) -> Template = select_compile_template(Type, compiler(Ext)), Cmd = expand_command(Template, Env, Source, Bin), CDBEnt = cdb_entry(Source, Cmd, Rest), + NewCDB = [CDBEnt | CDB], case needs_compile(Source, Bin) of true -> ShOpts = [{env, Env}, return_on_error, {use_stdout, false}], exec_compiler(Config, Source, Cmd, ShOpts), compile_each(Config, Rest, Type, Env, - {[Bin | NewBins], [CDBEnt | CDB]}); + {[Bin | NewBins], NewCDB}); false -> ?INFO("Skipping ~s\n", [Source]), - compile_each(Config, Rest, Type, Env, {NewBins, [CDBEnt, CDB]}) + compile_each(Config, Rest, Type, Env, {NewBins, NewCDB}) end. %% Generate a clang compilation db entry for Src and Cmd @@ -394,7 +395,8 @@ get_port_spec(Config, OsType, {_Arch, Target, Sources, Opts}) -> LinkLang = case lists:any( fun(Src) -> compiler(filename:extension(Src)) == "$CXX" end, - SourceFiles) of + SourceFiles) + of true -> cxx; false -> cc end, |