@@ -1429,12 +1429,9 @@ sub process_component_line {
14291429 my $over = $self -> {' flag_overrides' }-> {$tag };
14301430 if (defined $over ) {
14311431 foreach my $file (@files ) {
1432- # # We are giving these flag overrides to multiple files. Since
1433- # # $flags is a hash reference, we need to make a copy so that
1434- # # modifying one of these files flag overrides doesn't modify
1435- # # all of them.
1436- my %copy = %$flags ;
1437- $$over {$file } = \%copy ;
1432+ # # We are giving these flag overrides to multiple files. We must
1433+ # # do so because these files are all in the same group.
1434+ $$over {$file } = $flags ;
14381435 }
14391436 }
14401437
@@ -3849,6 +3846,10 @@ sub generate_defaults {
38493846 $file , $self -> {' valid_components' }-> {$gentype });
38503847 my ($tied , $vc ) = $cmdHelper -> get_tied($file , \@files );
38513848 foreach my $tie (@$tied ) {
3849+ # # We have a tied file, now we need to actually perform
3850+ # # the tieing of the two. We will do this by saying that
3851+ # # the output of the original is necessary for the
3852+ # # processing of the tied file.
38523853 my @gen ;
38533854 if (!defined $vc ) {
38543855 foreach $vc (@vc ) {
@@ -3857,11 +3858,6 @@ sub generate_defaults {
38573858 last if ($#gen >= 0);
38583859 }
38593860 }
3860-
3861- # # We have a tied file, now we need to actually perform
3862- # # the tieing of the two. We will do this by saying that
3863- # # the output of the original is necessary for the
3864- # # processing of the tied file.
38653861 @gen = $self -> generated_filenames($part , $gentype ,
38663862 $vc , $file ) if (!$gen [0]);
38673863
@@ -3870,13 +3866,35 @@ sub generate_defaults {
38703866 # # ($gentype), so we just add the first one and
38713867 # # we're done.
38723868 my $first = $gen [0];
3873- $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } =
3874- $self -> {' generated_exts' }-> {$gentype }-> {$dep }
3875- if (!defined $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep });
3869+ my $needcopy = 1;
3870+ if (!defined $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep }) {
3871+ # # We are about to modify the flag overrides for a tied file.
3872+ # # We need to make a copy so that we do not affect the
3873+ # # overrides of grouped, but no longer affiliated files.
3874+ my %copy = %{$self -> {' flag_overrides' }-> {$gentype }-> {$tie }};
3875+ $self -> {' flag_overrides' }-> {$gentype }-> {$tie } = \%copy ;
3876+ $needcopy = undef ;
3877+
3878+ # # Start a new dependent setting based on the original
3879+ # # custom build settings.
3880+ $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } =
3881+ $self -> {' generated_exts' }-> {$gentype }-> {$dep };
3882+ }
38763883
3877- $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } .= " $first "
38783884 if (!defined $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } ||
3879- $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } !~ / \b $first \b / );
3885+ $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } !~ / \b $first \b / ) {
3886+ if ($needcopy ) {
3887+ # # We are about to modify the flag overrides for a tied file.
3888+ # # We need to make a copy so that we do not affect the
3889+ # # overrides of grouped, but no longer affiliated files.
3890+ my %copy = %{$self -> {' flag_overrides' }-> {$gentype }-> {$tie }};
3891+ $self -> {' flag_overrides' }-> {$gentype }-> {$tie } = \%copy ;
3892+ $needcopy = undef ;
3893+ }
3894+
3895+ # # Update the dependent value for this tied file.
3896+ $self -> {' flag_overrides' }-> {$gentype }-> {$tie }-> {$dep } .= " $first " ;
3897+ }
38803898 }
38813899 }
38823900 }
0 commit comments