@@ -3,7 +3,7 @@ package Project;
3
3
#
4
4
# Package that encapsulates a Visual C++ project file generation
5
5
#
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 $
7
7
#
8
8
use Carp;
9
9
use strict;
@@ -33,7 +33,8 @@ sub new
33
33
solution => $solution ,
34
34
disablewarnings => ' 4018;4244;4273;4102;4090' ,
35
35
disablelinkerwarnings => ' ' ,
36
- vcver => $solution -> {vcver }
36
+ vcver => $solution -> {vcver },
37
+ platform => $solution -> {platform },
37
38
};
38
39
39
40
bless $self ;
391
392
$of =~ s /\. y$/ .c/ ;
392
393
$of =~ s { ^src\\ pl\\ plpgsql\\ src\\ gram.c$} { src\\ pl\\ plpgsql\\ src\\ pl_gram.c} ;
393
394
print F ' >'
394
- . GenerateCustomTool(' Running bison on ' . $f ,
395
+ . $self -> GenerateCustomTool(' Running bison on ' . $f ,
395
396
' cmd /V:ON /c src\tools\msvc\pgbison.bat ' . $f , $of )
396
397
. ' </File>' . " \n " ;
397
398
}
400
401
my $of = $f ;
401
402
$of =~ s /\. l$/ .c/ ;
402
403
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 )
404
405
. ' </File>' . " \n " ;
405
406
}
406
407
elsif (defined ($uniquefiles {$file }))
410
411
my $obj = $dir ;
411
412
$obj =~ s /\\ / _/ g ;
412
413
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 "
415
416
. " _$file .obj\" /></FileConfiguration></File>\n " ;
416
417
}
417
418
else
@@ -431,14 +432,14 @@ EOF
431
432
432
433
sub GenerateCustomTool
433
434
{
434
- my ($desc , $tool , $output , $cfg ) = @_ ;
435
+ my ($self , $ desc , $tool , $output , $cfg ) = @_ ;
435
436
if (!defined ($cfg ))
436
437
{
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' );
439
440
}
440
441
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>" ;
442
443
}
443
444
444
445
sub WriteReferences
@@ -460,7 +461,7 @@ sub WriteHeader
460
461
print $f <<EOF ;
461
462
<?xml version="1.0" encoding="Windows-1252"?>
462
463
<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>
464
465
<Configurations>
465
466
EOF
466
467
$self -> WriteConfiguration($f , ' Debug' ,
@@ -493,8 +494,9 @@ sub WriteConfiguration
493
494
}
494
495
$libs =~ s / $// ;
495
496
$libs =~ s / __CFGNAME__/ $cfgname / g ;
497
+ my $targetmachine = $self -> {platform } eq ' Win32' ? 1 : 17;
496
498
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}"
498
500
ConfigurationType="$cfgtype " UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p ->{wholeopt}">
499
501
<Tool Name="VCCLCompilerTool" Optimization="$p ->{opt}"
500
502
AdditionalIncludeDirectories="$self ->{prefixincludes}src/include;src/include/port/win32;src/include/port/win32_msvc;$self ->{includes}"
513
515
StackReserveSize="4194304" DisableSpecificWarnings="$self ->{disablewarnings}"
514
516
GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\ $cfgname \\ $self ->{name}\\ $self ->{name}.pdb"
515
517
GenerateMapFile="FALSE" MapFileName=".\\ $cfgname \\ $self ->{name}\\ $self ->{name}.map"
516
- SubSystem="1" TargetMachine="1 "
518
+ SubSystem="1" TargetMachine="$targetmachine "
517
519
EOF
518
520
if ($self -> {disablelinkerwarnings })
519
521
{
540
542
if ($self -> {builddef })
541
543
{
542
544
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 " ;
544
546
}
545
547
print $f <<EOF ;
546
548
</Configuration>
0 commit comments