From 927d61eeff78363ea3938c818d07e511ebaf75cf Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 10 Jun 2012 15:20:04 -0400 Subject: Run pgindent on 9.2 source tree in preparation for first 9.3 commit-fest. --- src/tools/msvc/MSBuildProject.pm | 325 ++++++++++++++++++++------------------- 1 file changed, 163 insertions(+), 162 deletions(-) (limited to 'src/tools/msvc/MSBuildProject.pm') diff --git a/src/tools/msvc/MSBuildProject.pm b/src/tools/msvc/MSBuildProject.pm index fcce9ebb68d..4e6ea1f7409 100644 --- a/src/tools/msvc/MSBuildProject.pm +++ b/src/tools/msvc/MSBuildProject.pm @@ -13,158 +13,159 @@ use base qw(Project); sub _new { - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); + my $classname = shift; + my $self = $classname->SUPER::_new(@_); + bless($self, $classname); - $self->{filenameExtension} = '.vcxproj'; + $self->{filenameExtension} = '.vcxproj'; - return $self; + return $self; } sub WriteHeader { - my ($self, $f) = @_; + my ($self, $f) = @_; - print $f < EOF - $self->WriteConfigurationHeader($f, 'Debug'); - $self->WriteConfigurationHeader($f, 'Release'); - print $f <WriteConfigurationHeader($f, 'Debug'); + $self->WriteConfigurationHeader($f, 'Release'); + print $f < $self->{guid} EOF - $self->WriteConfigurationPropertyGroup($f, 'Release',{ wholeopt=>'false' }); - $self->WriteConfigurationPropertyGroup($f, 'Debug',{ wholeopt=>'false' }); - print $f <WriteConfigurationPropertyGroup($f, 'Release',{wholeopt=>'false'}); + $self->WriteConfigurationPropertyGroup($f, 'Debug',{wholeopt=>'false'}); + print $f < EOF - $self->WritePropertySheetsPropertyGroup($f, 'Release'); - $self->WritePropertySheetsPropertyGroup($f, 'Debug'); - print $f <WritePropertySheetsPropertyGroup($f, 'Release'); + $self->WritePropertySheetsPropertyGroup($f, 'Debug'); + print $f < <_ProjectFileVersion>10.0.30319.1 EOF - $self->WriteAdditionalProperties($f, 'Debug'); - $self->WriteAdditionalProperties($f, 'Release'); - print $f <WriteAdditionalProperties($f, 'Debug'); + $self->WriteAdditionalProperties($f, 'Release'); + print $f < EOF - $self->WriteItemDefinitionGroup( - $f, 'Debug', - { - defs=>'_DEBUG;DEBUG=1;', - opt=>'Disabled', - strpool=>'false', - runtime=>'MultiThreadedDebugDLL' - } - ); - $self->WriteItemDefinitionGroup($f, 'Release', - { defs=>'', opt=>'Full', strpool=>'true', runtime=>'MultiThreadedDLL' }); + $self->WriteItemDefinitionGroup( + $f, 'Debug', + { + defs=>'_DEBUG;DEBUG=1;', + opt=>'Disabled', + strpool=>'false', + runtime=>'MultiThreadedDebugDLL' + } + ); + $self->WriteItemDefinitionGroup($f, 'Release', + {defs=>'', opt=>'Full', strpool=>'true', runtime=>'MultiThreadedDLL'}); } sub AddDefine { - my ($self, $def) = @_; + my ($self, $def) = @_; - $self->{defines} .= $def . ';'; + $self->{defines} .= $def . ';'; } sub WriteReferences { - my ($self, $f) = @_; + my ($self, $f) = @_; - my @references = @{$self->{references}}; + my @references = @{$self->{references}}; - if (scalar(@references)) - { - print $f < EOF - foreach my $ref (@references) - { - print $f < $ref->{guid} EOF - } - print $f < EOF - } + } } sub WriteFiles { - my ($self, $f) = @_; - print $f < EOF - my @grammarFiles = (); - my @resourceFiles = (); - my %uniquefiles; - foreach my $fileNameWithPath (sort keys %{ $self->{files} }) - { - confess "Bad format filename '$fileNameWithPath'\n" - unless ($fileNameWithPath =~ /^(.*)\\([^\\]+)\.[r]?[cyl]$/); - my $dir = $1; - my $fileName = $2; - if ($fileNameWithPath =~ /\.y$/ or $fileNameWithPath =~ /\.l$/) - { - push @grammarFiles, $fileNameWithPath; - } - elsif ($fileNameWithPath =~ /\.rc$/) - { - push @resourceFiles, $fileNameWithPath; - } - elsif (defined($uniquefiles{$fileName})) - { - - # File already exists, so fake a new name - my $obj = $dir; - $obj =~ s/\\/_/g; - - print $f <{files}}) + { + confess "Bad format filename '$fileNameWithPath'\n" + unless ($fileNameWithPath =~ /^(.*)\\([^\\]+)\.[r]?[cyl]$/); + my $dir = $1; + my $fileName = $2; + if ($fileNameWithPath =~ /\.y$/ or $fileNameWithPath =~ /\.l$/) + { + push @grammarFiles, $fileNameWithPath; + } + elsif ($fileNameWithPath =~ /\.rc$/) + { + push @resourceFiles, $fileNameWithPath; + } + elsif (defined($uniquefiles{$fileName})) + { + + # File already exists, so fake a new name + my $obj = $dir; + $obj =~ s/\\/_/g; + + print $f < .\\debug\\$self->{name}\\${obj}_$fileName.obj .\\release\\$self->{name}\\${obj}_$fileName.obj EOF - } - else - { - $uniquefiles{$fileName} = 1; - print $f < EOF - } + } - } - print $f < EOF - if (scalar(@grammarFiles)) - { - print $f < EOF - foreach my $grammarFile (@grammarFiles) - { - (my $outputFile = $grammarFile) =~ s/\.(y|l)$/.c/; - if ($grammarFile =~ /\.y$/) - { - $outputFile =~ s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c}; - print $f < Running bison on $grammarFile perl "src\\tools\\msvc\\pgbison.pl" "$grammarFile" @@ -176,10 +177,10 @@ EOF $outputFile;%(Outputs) EOF - } - else #if ($grammarFile =~ /\.l$/) - { - print $f < Running flex on $grammarFile perl "src\\tools\\msvc\\pgflex.pl" "$grammarFile" @@ -191,33 +192,33 @@ EOF $outputFile;%(Outputs) EOF - } - } - print $f < EOF - } - if (scalar(@resourceFiles)) - { - print $f < EOF - foreach my $rcFile (@resourceFiles) - { - print $f < EOF - } - print $f < EOF - } + } } sub WriteConfigurationHeader { - my ($self, $f, $cfgname) = @_; - print $f < $cfgname $self->{platform} @@ -227,13 +228,13 @@ EOF sub WriteConfigurationPropertyGroup { - my ($self, $f, $cfgname, $p) = @_; - my $cfgtype = - ($self->{type} eq "exe") - ?'Application' - :($self->{type} eq "dll"?'DynamicLibrary':'StaticLibrary'); + my ($self, $f, $cfgname, $p) = @_; + my $cfgtype = + ($self->{type} eq "exe") + ?'Application' + :($self->{type} eq "dll"?'DynamicLibrary':'StaticLibrary'); - print $f < $cfgtype false @@ -245,8 +246,8 @@ EOF sub WritePropertySheetsPropertyGroup { - my ($self, $f, $cfgname) = @_; - print $f < @@ -255,8 +256,8 @@ EOF sub WriteAdditionalProperties { - my ($self, $f, $cfgname) = @_; - print $f <.\\$cfgname\\$self->{name}\\ .\\$cfgname\\$self->{name}\\ false @@ -265,21 +266,21 @@ EOF sub WriteItemDefinitionGroup { - my ($self, $f, $cfgname, $p) = @_; - my $cfgtype = - ($self->{type} eq "exe") - ?'Application' - :($self->{type} eq "dll"?'DynamicLibrary':'StaticLibrary'); - my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ';'); - - my $targetmachine = $self->{platform} eq 'Win32' ? 'MachineX86' : 'MachineX64'; - - my $includes = $self->{includes}; - unless ($includes eq '' or $includes =~ /;$/) - { - $includes .= ';'; - } - print $f <{type} eq "exe") + ?'Application' + :($self->{type} eq "dll"?'DynamicLibrary':'StaticLibrary'); + my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ';'); + + my $targetmachine = $self->{platform} eq 'Win32' ? 'MachineX86' : 'MachineX64'; + + my $includes = $self->{includes}; + unless ($includes eq '' or $includes =~ /;$/) + { + $includes .= ';'; + } + print $f < $p->{opt} @@ -314,49 +315,49 @@ sub WriteItemDefinitionGroup Console $targetmachine EOF - if ($self->{disablelinkerwarnings}) - { - print $f + if ($self->{disablelinkerwarnings}) + { + print $f " /ignore:$self->{disablelinkerwarnings} \%(AdditionalOptions)\n"; - } - if ($self->{implib}) - { - my $l = $self->{implib}; - $l =~ s/__CFGNAME__/$cfgname/g; - print $f " $l\n"; - } - if ($self->{def}) - { - my $d = $self->{def}; - $d =~ s/__CFGNAME__/$cfgname/g; - print $f " $d\n"; - } - print $f <{implib}) + { + my $l = $self->{implib}; + $l =~ s/__CFGNAME__/$cfgname/g; + print $f " $l\n"; + } + if ($self->{def}) + { + my $d = $self->{def}; + $d =~ s/__CFGNAME__/$cfgname/g; + print $f " $d\n"; + } + print $f < src\\include;\%(AdditionalIncludeDirectories) EOF - if ($self->{builddef}) - { - print $f <{builddef}) + { + print $f < Generate DEF file perl src\\tools\\msvc\\gendef.pl $cfgname\\$self->{name} $self->{platform} EOF - } - print $f < EOF } sub Footer { - my ($self, $f) = @_; - $self->WriteReferences($f); + my ($self, $f) = @_; + $self->WriteReferences($f); - print $f < @@ -376,13 +377,13 @@ use base qw(MSBuildProject); sub new { - my $classname = shift; - my $self = $classname->SUPER::_new(@_); - bless($self, $classname); + my $classname = shift; + my $self = $classname->SUPER::_new(@_); + bless($self, $classname); - $self->{vcver} = '10.00'; + $self->{vcver} = '10.00'; - return $self; + return $self; } 1; -- cgit v1.2.3