diff options
author | wilson_d <wilson_d@a3e5c962-4219-0410-a828-e124f845ac39> | 2003-09-22 16:18:21 +0000 |
---|---|---|
committer | wilson_d <wilson_d@a3e5c962-4219-0410-a828-e124f845ac39> | 2003-09-22 16:18:21 +0000 |
commit | 2bb0d00901d0fea76e5db06a7e9b77df035420a7 (patch) | |
tree | 755ed914afad5398ca7d2e0af528a3daf860b9cb | |
parent | 690c9324a30a3372301f938cc18a13a86cacd253 (diff) | |
download | MPC-unlabeled-1.9.22.tar.gz |
ChangeLogTag: Mon Sep 16 13:33:50 2003 Dale Wilson <wilson_d@ociweb.com>unlabeled-1.9.22
-rw-r--r-- | modules/VC7WorkspaceCreator.pm | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/modules/VC7WorkspaceCreator.pm b/modules/VC7WorkspaceCreator.pm index 146a775d..a1161200 100644 --- a/modules/VC7WorkspaceCreator.pm +++ b/modules/VC7WorkspaceCreator.pm @@ -22,6 +22,10 @@ use vars qw(@ISA); # Subroutine Section # ************************************************************ +sub allow_duplicates { + my($self) = shift; + return 0; +} sub crlf { my($self) = shift; @@ -51,6 +55,7 @@ sub print_inner_project { #my($gen) = shift; #my($pguid) = shift; #my($deps) = shift; + #my($name) = shift; } @@ -76,18 +81,26 @@ sub print_dependencies { my($pjs) = shift; my($crlf) = $self->crlf(); + ## I hate to add yet another loop through all the projects, but + ## we must have some way to map plain project names to guids. + my(%name_to_guid_map) = (); + foreach my $project(@$list) { + my($name, $deps, $guid) = @{$$pjs{$project}}; + $name_to_guid_map{$name} = $guid; + } + ## Project Dependencies print $fh "\tGlobalSection(ProjectDependencies) = postSolution$crlf"; foreach my $project (@$list) { - my($name, $rawdeps, $pguid) = @{$$pjs{$project}}; + my($name, $rawdeps, $project_guid) = @{$$pjs{$project}}; my($deps) = $self->get_validated_ordering($project); if (defined $deps && $deps ne '') { my($darr) = $self->create_array($deps); my($i) = 0; foreach my $dep (@$darr) { - my($val) = $gen->specific_lookup($dep); - if (defined $val && $pguid ne $val) { - print $fh "\t\t{$pguid}.$i = {$val}$crlf"; + my($guid) = $name_to_guid_map{$dep}; + if (defined $guid && $guid ne $project_guid) { + print $fh "\t\t{$project_guid}.$i = {$guid}$crlf"; $i++; } } @@ -102,22 +115,27 @@ sub write_comps { my($fh) = shift; my($gen) = shift; my($projects) = $self->get_projects(); - my($guid) = '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942'; + my($vc7guid) = '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942'; my($pjs) = $self->get_project_info(); my(@list) = $self->sort_dependencies($projects, $pjs); my($crlf) = $self->crlf(); - ## $guid above is the VC7 Project GUID. It should not change. + ## I hate to add yet another loop through all the projects, but + ## we must have some way to map plain project names to guids. + my(%name_to_guid_map) = (); + foreach my $project(sort @list) { + my($name, $deps, $guid) = @{$$pjs{$project}}; + $name_to_guid_map{$name} = $guid; + } ## Project Information foreach my $project (sort @list) { - my($name, $rawdeps, $pguid) = @{$$pjs{$project}}; + my($name, $rawdeps, $guid) = @{$$pjs{$project}}; my($deps) = $self->get_validated_ordering($project); - ## Convert all /'s to \ my($cpy) = $self->slash_to_backslash($project); - print $fh "Project(\"{$guid}\") = \"$name\", \"$cpy\", \"{$pguid}\"$crlf"; - $self->print_inner_project($fh, $gen, $pguid, $deps); + print $fh "Project(\"{$vc7guid}\") = \"$name\", \"$cpy\", \"{$guid}\"$crlf"; + $self->print_inner_project($fh, $gen, $guid, $deps, $name, \%name_to_guid_map); print $fh "EndProject$crlf"; } |