summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-04-21 14:17:41 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-04-21 14:17:41 +0000
commite3285cbf63ce2e3f68bca2e1ae4fc958f0052128 (patch)
tree346bffc7442f3fadd3a81a39cff8169d0996cdca
parent91f7bbb9ef2e6a81c51b61bf4b3466d833826e6e (diff)
downloadMPC-e3285cbf63ce2e3f68bca2e1ae4fc958f0052128.tar.gz
ChangeLogTag: Mon Apr 21 09:14:09 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/ProjectCreator.pm39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 65128e84..b7bee0b9 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -824,6 +824,41 @@ sub fix_pch_filenames {
}
+sub remove_extra_pch_listings {
+ my($self) = shift;
+ my(@pchs) = ('pch_header', 'pch_source');
+ my(@tags) = ('header_files', 'source_files');
+
+ for(my $j = 0; $j <= $#pchs; ++$j) {
+ my($pch) = $self->get_assignment($pchs[$j]);
+
+ if (defined $pch) {
+ ## If we are converting slashes, then we need to
+ ## convert the pch file back to forward slashes
+ if ($self->convert_slashes()) {
+ $pch =~ s/\\/\//g;
+ }
+
+ ## Find out which files are duplicated
+ my($names) = $self->{$tags[$j]};
+ foreach my $name (keys %$names) {
+ my($comps) = $$names{$name};
+ foreach my $key (keys %$comps) {
+ my($array) = $$comps{$key};
+ my($count) = scalar(@$array);
+ for(my $i = 0; $i < $count; ++$i) {
+ if ($pch eq $$array[$i]) {
+ splice(@$array, $i, 1);
+ --$count;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
sub is_special_tag {
my($self) = shift;
my($tag) = shift;
@@ -1244,6 +1279,10 @@ sub generate_defaults {
## If we do not do this, then generated projects can be invalid.
$self->remove_duplicated_files('source_files', 'template_files');
+ ## If pch files are listed in header_files or source_files more than
+ ## once, we need to remove the extras
+ $self->remove_extra_pch_listings();
+
## Generate the default idl generated list of source files
## only if we defaulted the idl file list
$self->generate_default_idl_generated(['source_files']);