summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2012-11-12 20:18:00 -0700
committerDave Smith <dizzyd@dizzyd.com>2012-11-12 20:18:00 -0700
commit7dad2b384b93889961383f1f75df5be865954639 (patch)
tree76cef7170dd1167c2e27a66a42df87136239056d /src
parentebb474b7593527969a8ce7d43b42f00e4498c391 (diff)
Be sure to filter empty sources (h/t to Tuncer and Joe Norton)
Diffstat (limited to 'src')
-rw-r--r--src/rebar_port_compiler.erl21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 71b27a5..70ee308 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -248,16 +248,17 @@ needs_link(SoName, NewBins) ->
%%
get_specs(Config, AppFile) ->
- case rebar_config:get_local(Config, port_specs, []) of
- [] ->
- %% No spec provided. Construct a spec
- %% from old-school so_name and sources
- [port_spec_from_legacy(Config, AppFile)];
- PortSpecs ->
- Filtered = filter_port_specs(PortSpecs),
- OsType = os:type(),
- [get_port_spec(Config, OsType, Spec) || Spec <- Filtered]
- end.
+ Specs = case rebar_config:get_local(Config, port_specs, []) of
+ [] ->
+ %% No spec provided. Construct a spec
+ %% from old-school so_name and sources
+ [port_spec_from_legacy(Config, AppFile)];
+ PortSpecs ->
+ Filtered = filter_port_specs(PortSpecs),
+ OsType = os:type(),
+ [get_port_spec(Config, OsType, Spec) || Spec <- Filtered]
+ end,
+ [S || S <- Specs, S#spec.sources /= []].
port_spec_from_legacy(Config, AppFile) ->
%% Get the target from the so_name variable