Skip to content

Commit

Permalink
Fix regression in port_compiler needs_link check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncer Ayaz committed Feb 10, 2012
1 parent ebb2345 commit b48cc0c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/rebar_port_compiler.erl
Expand Up @@ -115,11 +115,11 @@ compile(Config, AppFile) ->
%% Only relink if necessary, given the Target
%% and list of new binaries
lists:foreach(
fun({Target, Sources}) ->
Bins = lists:map(fun source_to_bin/1, Sources),
fun({Target, Bins}) ->
AllBins = [sets:from_list(Bins),
sets:from_list(NewBins)],
Intersection = sets:intersection(AllBins),
?DEBUG("Bins: ~p NewBins: ~p~n", [Bins, NewBins]),
case needs_link(Target, sets:to_list(Intersection)) of
true ->
LinkTemplate = select_link_template(Target),
Expand Down Expand Up @@ -559,14 +559,20 @@ make_port_specs(Config, AppFile, Bins) ->
true
end, PortSpecs),
%% TODO: DEPRECATED: remove support for non-port_specs syntax


%% drop ArchRegex from specs
lists:map(fun({_, Target, Sources}) ->
{Target, Sources};
(Spec) ->
Spec
lists:map(fun({_, Target, RawSources}) ->
{Target, sources_to_bins(RawSources)};
({Target, RawSources}) ->
{Target, sources_to_bins(RawSources)}
end, Specs0)
end.

sources_to_bins(RawSources) ->
Sources = lists:flatmap(fun filelib:wildcard/1, RawSources),
lists:map(fun source_to_bin/1, Sources).

%% DEPRECATED
make_so_specs(Config, AppFile, Bins) ->
case rebar_config:get(Config, so_specs, undefined) of
Expand Down

0 comments on commit b48cc0c

Please sign in to comment.