Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 693c85d

Browse files
committed
When using MSVC, disable the building of ecpg if pthreads is not
specified. Magnus Hagander
1 parent 0887fa1 commit 693c85d

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

src/tools/msvc/Project.pm

+3-1
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,13 @@ sub WriteConfiguration
367367
}
368368
$libs =~ s/ $//;
369369
$libs =~ s/__CFGNAME__/$cfgname/g;
370+
my $pth = $self->{solution}->{options}->{pthread};
371+
$pth = '' unless $pth;
370372
print $f <<EOF;
371373
<Configuration Name="$cfgname|Win32" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}"
372374
ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}">
373375
<Tool Name="VCCLCompilerTool" Optimization="$p->{opt}"
374-
AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$self->{solution}->{options}->{pthread};$self->{includes}"
376+
AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$pth;$self->{includes}"
375377
PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}"
376378
StringPooling="$p->{strpool}"
377379
RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}"

src/tools/msvc/Solution.pm

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use warnings;
66
sub new {
77
my $junk = shift;
88
my $options = shift;
9-
die "Pthreads is required.\n" unless $options->{pthread};
109
my $self = {
1110
projects => {},
1211
options => $options,

src/tools/msvc/mkvcbuild.pl

+27-22
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,33 @@
9090
$pgtypes->AddReference($postgres,$libpgport);
9191
$pgtypes->AddIncludeDir('src\interfaces\ecpg\include');
9292

93-
my $libecpg = $solution->AddProject('libecpg','dll','interfaces','src\interfaces\ecpg\ecpglib');
94-
$libecpg->AddDefine('FRONTEND');
95-
$libecpg->AddIncludeDir('src\interfaces\ecpg\include');
96-
$libecpg->AddIncludeDir('src\interfaces\libpq');
97-
$libecpg->AddIncludeDir('src\port');
98-
$libecpg->AddLibrary('wsock32.lib');
99-
$libecpg->AddLibrary($config->{'pthread'} . '\pthreadVC2.lib');
100-
$libecpg->AddReference($libpq,$pgtypes);
101-
102-
my $libecpgcompat = $solution->AddProject('libecpg_compat','dll','interfaces','src\interfaces\ecpg\compatlib');
103-
$libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include');
104-
$libecpgcompat->AddIncludeDir('src\interfaces\libpq');
105-
$libecpgcompat->AddReference($pgtypes,$libecpg);
106-
107-
my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc');
108-
$ecpg->AddIncludeDir('src\interfaces\ecpg\include');
109-
$ecpg->AddIncludeDir('src\interfaces\libpq');
110-
$ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y');
111-
$ecpg->AddDefine('MAJOR_VERSION=4');
112-
$ecpg->AddDefine('MINOR_VERSION=2');
113-
$ecpg->AddDefine('PATCHLEVEL=1');
114-
$ecpg->AddReference($libpgport);
93+
if ($config->{pthread}) {
94+
my $libecpg = $solution->AddProject('libecpg','dll','interfaces','src\interfaces\ecpg\ecpglib');
95+
$libecpg->AddDefine('FRONTEND');
96+
$libecpg->AddIncludeDir('src\interfaces\ecpg\include');
97+
$libecpg->AddIncludeDir('src\interfaces\libpq');
98+
$libecpg->AddIncludeDir('src\port');
99+
$libecpg->AddLibrary('wsock32.lib');
100+
$libecpg->AddLibrary($config->{'pthread'} . '\pthreadVC2.lib');
101+
$libecpg->AddReference($libpq,$pgtypes);
102+
103+
my $libecpgcompat = $solution->AddProject('libecpg_compat','dll','interfaces','src\interfaces\ecpg\compatlib');
104+
$libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include');
105+
$libecpgcompat->AddIncludeDir('src\interfaces\libpq');
106+
$libecpgcompat->AddReference($pgtypes,$libecpg);
107+
108+
my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc');
109+
$ecpg->AddIncludeDir('src\interfaces\ecpg\include');
110+
$ecpg->AddIncludeDir('src\interfaces\libpq');
111+
$ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y');
112+
$ecpg->AddDefine('MAJOR_VERSION=4');
113+
$ecpg->AddDefine('MINOR_VERSION=2');
114+
$ecpg->AddDefine('PATCHLEVEL=1');
115+
$ecpg->AddReference($libpgport);
116+
}
117+
else {
118+
print "Not building ecpg due to lack of pthreads.\n";
119+
}
115120

116121

117122
# src/bin

0 commit comments

Comments
 (0)