@@ -3,7 +3,7 @@ package Project;
33#
44# Package that encapsulates a Visual C++ project file generation
55#
6- # $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.22 2009/12/23 13:27:04 mha Exp $
6+ # $PostgreSQL: pgsql/src/tools/msvc/Project.pm,v 1.23 2010/01/01 17:34:25 mha Exp $
77#
88use Carp;
99use strict;
@@ -33,7 +33,8 @@ sub new
3333 solution => $solution ,
3434 disablewarnings => ' 4018;4244;4273;4102;4090' ,
3535 disablelinkerwarnings => ' ' ,
36- vcver => $solution -> {vcver }
36+ vcver => $solution -> {vcver },
37+ platform => $solution -> {platform },
3738 };
3839
3940 bless $self ;
391392 $of =~ s /\. y$/ .c/ ;
392393 $of =~ s { ^src\\ pl\\ plpgsql\\ src\\ gram.c$} { src\\ pl\\ plpgsql\\ src\\ pl_gram.c} ;
393394 print F ' >'
394- . GenerateCustomTool(' Running bison on ' . $f ,
395+ . $self -> GenerateCustomTool(' Running bison on ' . $f ,
395396 ' cmd /V:ON /c src\tools\msvc\pgbison.bat ' . $f , $of )
396397 . ' </File>' . " \n " ;
397398 }
400401 my $of = $f ;
401402 $of =~ s /\. l$/ .c/ ;
402403 print F ' >'
403- . GenerateCustomTool(' Running flex on ' . $f , ' src\tools\msvc\pgflex.bat ' . $f ,$of )
404+ . $self -> GenerateCustomTool(' Running flex on ' . $f , ' src\tools\msvc\pgflex.bat ' . $f ,$of )
404405 . ' </File>' . " \n " ;
405406 }
406407 elsif (defined ($uniquefiles {$file }))
410411 my $obj = $dir ;
411412 $obj =~ s /\\ / _/ g ;
412413 print F
413- " ><FileConfiguration Name=\" Debug|Win32 \" ><Tool Name=\" VCCLCompilerTool\" ObjectFile=\" .\\ debug\\ $self ->{name}\\ $obj "
414- . " _$file .obj\" /></FileConfiguration><FileConfiguration Name=\" Release|Win32 \" ><Tool Name=\" VCCLCompilerTool\" ObjectFile=\" .\\ release\\ $self ->{name}\\ $obj "
414+ " ><FileConfiguration Name=\" Debug|$self ->{platform} \" ><Tool Name=\" VCCLCompilerTool\" ObjectFile=\" .\\ debug\\ $self ->{name}\\ $obj "
415+ . " _$file .obj\" /></FileConfiguration><FileConfiguration Name=\" Release|$self ->{platform} \" ><Tool Name=\" VCCLCompilerTool\" ObjectFile=\" .\\ release\\ $self ->{name}\\ $obj "
415416 . " _$file .obj\" /></FileConfiguration></File>\n " ;
416417 }
417418 else
@@ -431,14 +432,14 @@ EOF
431432
432433sub GenerateCustomTool
433434{
434- my ($desc , $tool , $output , $cfg ) = @_ ;
435+ my ($self , $ desc , $tool , $output , $cfg ) = @_ ;
435436 if (!defined ($cfg ))
436437 {
437- return GenerateCustomTool($desc , $tool , $output , ' Debug' )
438- . GenerateCustomTool($desc , $tool , $output , ' Release' );
438+ return $self -> GenerateCustomTool($desc , $tool , $output , ' Debug' ) .
439+ $self -> GenerateCustomTool($desc , $tool , $output , ' Release' );
439440 }
440441 return
441- " <FileConfiguration Name=\" $cfg |Win32 \" ><Tool Name=\" VCCustomBuildTool\" Description=\" $desc \" CommandLine=\" $tool \" AdditionalDependencies=\"\" Outputs=\" $output \" /></FileConfiguration>" ;
442+ " <FileConfiguration Name=\" $cfg |$self ->{platform} \" ><Tool Name=\" VCCustomBuildTool\" Description=\" $desc \" CommandLine=\" $tool \" AdditionalDependencies=\"\" Outputs=\" $output \" /></FileConfiguration>" ;
442443}
443444
444445sub WriteReferences
@@ -460,7 +461,7 @@ sub WriteHeader
460461 print $f <<EOF ;
461462<?xml version="1.0" encoding="Windows-1252"?>
462463<VisualStudioProject ProjectType="Visual C++" Version="$self ->{vcver}" Name="$self ->{name}" ProjectGUID="$self ->{guid}">
463- <Platforms><Platform Name="Win32 "/></Platforms>
464+ <Platforms><Platform Name="$self ->{platform} "/></Platforms>
464465 <Configurations>
465466EOF
466467 $self -> WriteConfiguration($f , ' Debug' ,
@@ -493,8 +494,9 @@ sub WriteConfiguration
493494 }
494495 $libs =~ s / $// ;
495496 $libs =~ s / __CFGNAME__/ $cfgname / g ;
497+ my $targetmachine = $self -> {platform } eq ' Win32' ? 1 : 17;
496498 print $f <<EOF ;
497- <Configuration Name="$cfgname |Win32 " OutputDirectory=".\\ $cfgname \\ $self ->{name}" IntermediateDirectory=".\\ $cfgname \\ $self ->{name}"
499+ <Configuration Name="$cfgname |$self ->{platform} " OutputDirectory=".\\ $cfgname \\ $self ->{name}" IntermediateDirectory=".\\ $cfgname \\ $self ->{name}"
498500 ConfigurationType="$cfgtype " UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p ->{wholeopt}">
499501 <Tool Name="VCCLCompilerTool" Optimization="$p ->{opt}"
500502 AdditionalIncludeDirectories="$self ->{prefixincludes}src/include;src/include/port/win32;src/include/port/win32_msvc;$self ->{includes}"
513515 StackReserveSize="4194304" DisableSpecificWarnings="$self ->{disablewarnings}"
514516 GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\ $cfgname \\ $self ->{name}\\ $self ->{name}.pdb"
515517 GenerateMapFile="FALSE" MapFileName=".\\ $cfgname \\ $self ->{name}\\ $self ->{name}.map"
516- SubSystem="1" TargetMachine="1 "
518+ SubSystem="1" TargetMachine="$targetmachine "
517519EOF
518520 if ($self -> {disablelinkerwarnings })
519521 {
540542 if ($self -> {builddef })
541543 {
542544 print $f
543- " \t <Tool Name=\" VCPreLinkEventTool\" Description=\" Generate DEF file\" CommandLine=\" perl src\\ tools\\ msvc\\ gendef.pl $cfgname \\ $self ->{name}\" />\n " ;
545+ " \t <Tool Name=\" VCPreLinkEventTool\" Description=\" Generate DEF file\" CommandLine=\" perl src\\ tools\\ msvc\\ gendef.pl $cfgname \\ $self ->{name} $self ->{platform} \" />\n " ;
544546 }
545547 print $f <<EOF ;
546548 </Configuration>
0 commit comments