diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm index 4b84c98ea2e2f18a61855393926c4552c29bba19..362611114a047a9cb3252ff793abea2d8cd7463c 100644 --- a/src/tools/msvc/Project.pm +++ b/src/tools/msvc/Project.pm @@ -367,11 +367,13 @@ sub WriteConfiguration } $libs =~ s/ $//; $libs =~ s/__CFGNAME__/$cfgname/g; + my $pth = $self->{solution}->{options}->{pthread}; + $pth = '' unless $pth; print $f <<EOF; <Configuration Name="$cfgname|Win32" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}" ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}"> <Tool Name="VCCLCompilerTool" Optimization="$p->{opt}" - AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$self->{solution}->{options}->{pthread};$self->{includes}" + AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$pth;$self->{includes}" PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}" StringPooling="$p->{strpool}" RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}" diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 4086f428f5b163584e5512291a9599d678f576a8..588f8c92a0d530913c2f344d16834b0fe7e7308e 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -6,7 +6,6 @@ use warnings; sub new { my $junk = shift; my $options = shift; - die "Pthreads is required.\n" unless $options->{pthread}; my $self = { projects => {}, options => $options, diff --git a/src/tools/msvc/mkvcbuild.pl b/src/tools/msvc/mkvcbuild.pl index c87420b0dc8c2c7ba9d9be71ba6b3c8fb5d7e287..2cb88c14b8d200343bfee35a97da428cd8559a5a 100644 --- a/src/tools/msvc/mkvcbuild.pl +++ b/src/tools/msvc/mkvcbuild.pl @@ -90,28 +90,33 @@ $pgtypes->AddDefine('FRONTEND'); $pgtypes->AddReference($postgres,$libpgport); $pgtypes->AddIncludeDir('src\interfaces\ecpg\include'); -my $libecpg = $solution->AddProject('libecpg','dll','interfaces','src\interfaces\ecpg\ecpglib'); -$libecpg->AddDefine('FRONTEND'); -$libecpg->AddIncludeDir('src\interfaces\ecpg\include'); -$libecpg->AddIncludeDir('src\interfaces\libpq'); -$libecpg->AddIncludeDir('src\port'); -$libecpg->AddLibrary('wsock32.lib'); -$libecpg->AddLibrary($config->{'pthread'} . '\pthreadVC2.lib'); -$libecpg->AddReference($libpq,$pgtypes); - -my $libecpgcompat = $solution->AddProject('libecpg_compat','dll','interfaces','src\interfaces\ecpg\compatlib'); -$libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include'); -$libecpgcompat->AddIncludeDir('src\interfaces\libpq'); -$libecpgcompat->AddReference($pgtypes,$libecpg); - -my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc'); -$ecpg->AddIncludeDir('src\interfaces\ecpg\include'); -$ecpg->AddIncludeDir('src\interfaces\libpq'); -$ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y'); -$ecpg->AddDefine('MAJOR_VERSION=4'); -$ecpg->AddDefine('MINOR_VERSION=2'); -$ecpg->AddDefine('PATCHLEVEL=1'); -$ecpg->AddReference($libpgport); +if ($config->{pthread}) { + my $libecpg = $solution->AddProject('libecpg','dll','interfaces','src\interfaces\ecpg\ecpglib'); + $libecpg->AddDefine('FRONTEND'); + $libecpg->AddIncludeDir('src\interfaces\ecpg\include'); + $libecpg->AddIncludeDir('src\interfaces\libpq'); + $libecpg->AddIncludeDir('src\port'); + $libecpg->AddLibrary('wsock32.lib'); + $libecpg->AddLibrary($config->{'pthread'} . '\pthreadVC2.lib'); + $libecpg->AddReference($libpq,$pgtypes); + + my $libecpgcompat = $solution->AddProject('libecpg_compat','dll','interfaces','src\interfaces\ecpg\compatlib'); + $libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include'); + $libecpgcompat->AddIncludeDir('src\interfaces\libpq'); + $libecpgcompat->AddReference($pgtypes,$libecpg); + + my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc'); + $ecpg->AddIncludeDir('src\interfaces\ecpg\include'); + $ecpg->AddIncludeDir('src\interfaces\libpq'); + $ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y'); + $ecpg->AddDefine('MAJOR_VERSION=4'); + $ecpg->AddDefine('MINOR_VERSION=2'); + $ecpg->AddDefine('PATCHLEVEL=1'); + $ecpg->AddReference($libpgport); +} +else { + print "Not building ecpg due to lack of pthreads.\n"; +} # src/bin