first commit for openGauss connect odbc code
This commit is contained in:
188
winbuild/BuildAll.ps1
Normal file
188
winbuild/BuildAll.ps1
Normal file
@ -0,0 +1,188 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Build all dlls of psqlodbc project using MSbuild.
|
||||
.DESCRIPTION
|
||||
Build psqlodbc35w.dll, psqlodbc30a.dll, pgenlist.dll, pgenlista.dll
|
||||
and pgxalib.dll for both x86 and x64 platforms.
|
||||
.PARAMETER Target
|
||||
Specify the target of MSBuild. "Build"(default), "Rebuild" or
|
||||
"Clean" is available.
|
||||
.PARAMETER VCVersion
|
||||
Visual Studio version is determined automatically unless this
|
||||
option is specified.
|
||||
.PARAMETER Platform
|
||||
Specify build platforms, "both"(default), "Win32" or "x64" is
|
||||
available.
|
||||
.PARAMETER AlongWithInstallers
|
||||
Specify when you'd like to build installers after building drivers.
|
||||
.PARAMETER Toolset
|
||||
MSBuild PlatformToolset is determined automatically unless this
|
||||
option is specified. Currently "v100", "Windows7.1SDK", "v110",
|
||||
"v110_xp", "v120", "v120_xp", "v140" or "v140_xp" is available.
|
||||
.PARAMETER MSToolsVersion
|
||||
MSBuild ToolsVersion is detemrined automatically unless this
|
||||
option is specified. Currently "4.0", "12.0" or "14.0" is available.
|
||||
.PARAMETER Configuration
|
||||
Specify "Release"(default) or "Debug".
|
||||
.PARAMETER BuildConfigPath
|
||||
Specify the configuration xml file name if you want to use
|
||||
the configuration file other than standard one.
|
||||
The relative path is relative to the current directory.
|
||||
.EXAMPLE
|
||||
> .\BuildAll
|
||||
Build with default or automatically selected parameters.
|
||||
.EXAMPLE
|
||||
> .\BuildAll Clean
|
||||
Clean all generated files.
|
||||
.EXAMPLE
|
||||
> .\BuildAll -V(CVersion) 11.0
|
||||
Build using Visual Studio 11.0 environment.
|
||||
.EXAMPLE
|
||||
> .\BuildAll -P(latform) x64
|
||||
Build only 64bit dlls.
|
||||
.EXAMPLE
|
||||
> .\BuildAll -A(longWithInstallers)
|
||||
Build installers as well after building drivers.
|
||||
.NOTES
|
||||
Author: Hiroshi Inoue
|
||||
Date: Febrary 1, 2014
|
||||
#>
|
||||
|
||||
#
|
||||
# build 32bit & 64bit dlls for VC10 or later
|
||||
#
|
||||
Param(
|
||||
[ValidateSet("Build", "Rebuild", "Clean", "info")]
|
||||
[string]$Target="Build",
|
||||
[string]$VCVersion,
|
||||
[ValidateSet("Win32", "x64", "both")]
|
||||
[string]$Platform="both",
|
||||
[string]$Toolset,
|
||||
[ValidateSet("", "4.0", "12.0", "14.0", "15.0")]
|
||||
[string]$MSToolsVersion,
|
||||
[ValidateSet("Debug", "Release")]
|
||||
[String]$Configuration="Release",
|
||||
[string]$BuildConfigPath,
|
||||
[switch]$AlongWithInstallers
|
||||
)
|
||||
|
||||
function buildPlatform([xml]$configInfo, [string]$Platform)
|
||||
{
|
||||
if ($Platform -ieq "x64") {
|
||||
$platinfo=$configInfo.Configuration.x64
|
||||
} else {
|
||||
$platinfo=$configInfo.Configuration.x86
|
||||
}
|
||||
$BUILD_MACROS=$platinfo.build_macros
|
||||
$PG_INC=getPGDir $configInfo $Platform "include"
|
||||
$PG_LIB=getPGDir $configInfo $Platform "lib"
|
||||
$PG_BIN=getPGDir $configInfo $Platform "bin"
|
||||
|
||||
Write-Host "USE LIBPQ : ($PG_INC $PG_LIB $PG_BIN)"
|
||||
|
||||
if (-not (Test-Path $PG_INC)) {
|
||||
throw("`n!!!! include directory $PG_INC does not exist`nplease specify the correct folder name using editConfiguration")
|
||||
}
|
||||
if (-not (Test-Path $PG_LIB)) {
|
||||
throw("`n!!!! lib directory $PG_LIB does not exist`nplease specify the correct folder name using editConfiguration")
|
||||
}
|
||||
if (-not (Test-Path $PG_BIN)) {
|
||||
throw("`n!!!! bin directory $PG_BIN does not exist`nplease specify the correct folder name using editConfiguration")
|
||||
}
|
||||
|
||||
$useSplit=$true
|
||||
if ($useSplit) {
|
||||
$macroList = -split $BUILD_MACROS
|
||||
} else {
|
||||
$BUILD_MACROS = $BUILD_MACROS -replace ';', '`;'
|
||||
$BUILD_MACROS = $BUILD_MACROS -replace '"', '`"'
|
||||
$macroList = iex "write-output $BUILD_MACROS"
|
||||
}
|
||||
& ${msbuildexe} ./platformbuild.vcxproj /tv:$MSToolsVersion "/p:Platform=$Platform;Configuration=$Configuration;PlatformToolset=${Toolset}" /t:$target /p:VisualStudioVersion=${VCVersion} /p:DRIVERVERSION=$DRIVERVERSION /p:PG_INC=$PG_INC /p:PG_LIB=$PG_LIB /p:PG_BIN=$PG_BIN $macroList
|
||||
}
|
||||
|
||||
$scriptPath = (Split-Path $MyInvocation.MyCommand.Path)
|
||||
Import-Module ${scriptPath}\Psqlodbc-config.psm1
|
||||
$configInfo = LoadConfiguration $BuildConfigPath $scriptPath
|
||||
$DRIVERVERSION=$configInfo.Configuration.version
|
||||
pushd $scriptPath
|
||||
$path_save = ${env:PATH}
|
||||
|
||||
Import-Module ${scriptPath}\MSProgram-Get.psm1
|
||||
try {
|
||||
$msbuildexe=Find-MSBuild ([ref]$VCVersion) ([ref]$MSToolsVersion) ([ref]$Toolset) $configInfo
|
||||
} catch [Exception] {
|
||||
if ("$_.Exception.Message" -ne "") {
|
||||
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||
} else {
|
||||
echo $_.Exception | Format-List -Force
|
||||
}
|
||||
popd
|
||||
Remove-Module Psqlodbc-config
|
||||
return
|
||||
} finally {
|
||||
Remove-Module MSProgram-Get
|
||||
}
|
||||
|
||||
$recordResult = $true
|
||||
try {
|
||||
#
|
||||
# build 32bit dlls
|
||||
#
|
||||
if ($Platform -ieq "Win32" -or $Platform -ieq "both") {
|
||||
buildPlatform $configInfo "Win32"
|
||||
if ($LastExitCode -ne 0) {
|
||||
$recordResult = $false
|
||||
}
|
||||
}
|
||||
#
|
||||
# build 64bit dlls
|
||||
#
|
||||
if ($recordResult -and ($Platform -ieq "x64" -or $Platform -ieq "both")) {
|
||||
buildPlatform $configInfo "x64"
|
||||
if ($LastExitCode -ne 0) {
|
||||
$recordResult = $false
|
||||
}
|
||||
}
|
||||
#
|
||||
# Write the result to configuration xml
|
||||
#
|
||||
$resultText="successful"
|
||||
if ($recordResult) {
|
||||
$configInfo.Configuration.BuildResult.Date=[string](Get-Date)
|
||||
$configInfo.Configuration.BuildResult.VisualStudioVersion=$VCVersion
|
||||
$configInfo.Configuration.BuildResult.PlatformToolset=$Toolset
|
||||
$configInfo.Configuration.BuildResult.ToolsVersion=$MSToolsVersion
|
||||
$configInfo.Configuration.BuildResult.Platform=$Platform
|
||||
SaveConfiguration $configInfo
|
||||
} else {
|
||||
$resultText="failed"
|
||||
}
|
||||
Write-Host "ToolsVersion=$MSToolsVersion VisualStudioVersion=$VCVersion PlatformToolset=$Toolset Platform=$Platform $resultText`n"
|
||||
#
|
||||
# build installers as well
|
||||
#
|
||||
if ($AlongWithInstallers) {
|
||||
if (-not $recordResult) {
|
||||
throw("compilation failed")
|
||||
}
|
||||
$cpu = $Platform
|
||||
if ($Platform -eq "win32") {
|
||||
$cpu = "x86"
|
||||
}
|
||||
..\installer\buildInstallers.ps1 -cpu $cpu -BuildConfigPath $BuildConfigPath
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to build installers"
|
||||
}
|
||||
}
|
||||
} catch [Exception] {
|
||||
if ("$_.Exception.Message" -ne "") {
|
||||
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||
} else {
|
||||
echo $_.Exception | Format-List -Force
|
||||
}
|
||||
} finally {
|
||||
$env:PATH = $path_save
|
||||
popd
|
||||
Remove-Module Psqlodbc-config
|
||||
}
|
405
winbuild/MSProgram-Get.psm1
Normal file
405
winbuild/MSProgram-Get.psm1
Normal file
@ -0,0 +1,405 @@
|
||||
|
||||
function Find-MSBuild
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[ref]$VCVersion,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ref]$MSToolsVersion,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[ref]$Toolset,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[xml]$configInfo)
|
||||
|
||||
$msbuildexe=""
|
||||
$VisualStudioVersion=$VCVersion.Value
|
||||
$MSToolsVersionv=$MSToolsVersion.Value
|
||||
$Toolsetv=$Toolset.Value
|
||||
|
||||
$WSDK71Set="Windows7.1SDK"
|
||||
$refnum=""
|
||||
Write-Debug "VCVersion=$VCVersionv $env:VisualStudioVersion"
|
||||
#
|
||||
# Determine VisualStudioVersion
|
||||
#
|
||||
if (("$VisualStudioVersion" -eq "") -And ($configInfo -ne $null)) {
|
||||
$VisualStudioVersion=$configInfo.Configuration.vcversion
|
||||
}
|
||||
if ("$VisualStudioVersion" -eq "") {
|
||||
$VisualStudioVersion = $env:VisualStudioVersion # VC11 or later version of C++ command prompt sets this variable
|
||||
}
|
||||
if ("$VisualStudioVersion" -eq "") {
|
||||
if ("${env:WindowsSDKVersionOverride}" -eq "v7.1") { # SDK7.1+ command prompt
|
||||
$VisualStudioVersion = "10.0"
|
||||
} elseif ("${env:VCInstallDir}" -ne "") { # C++ command prompt
|
||||
if ("${env:VCInstallDir}" -match "Visual Studio\s*(\S+)\\VC\\$") {
|
||||
$VisualStudioVersion = $matches[1]
|
||||
}
|
||||
}
|
||||
}
|
||||
# neither C++ nor SDK prompt
|
||||
if ("$VisualStudioVersion" -eq "") {
|
||||
if ("${env:VS120COMNTOOLS}" -ne "") { # VC12 is installed (current official)
|
||||
$VisualStudioVersion = "12.0"
|
||||
} elseif ((Find-VSDir 15) -ne "") { # VC15 is installed
|
||||
$VisualStudioVersion = "15.0"
|
||||
} elseif ("${env:VS140COMNTOOLS}" -ne "") { # VC14 is installed
|
||||
$VisualStudioVersion = "14.0"
|
||||
} elseif ("${env:VS100COMNTOOLS}" -ne "") { # VC10 is installed
|
||||
$VisualStudioVersion = "10.0"
|
||||
} elseif ("${env:VS110COMNTOOLS}" -ne "") { # VC11 is installed
|
||||
$VisualStudioVersion = "11.0"
|
||||
} else {
|
||||
throw "Visual Studio >= 10.0 not found"
|
||||
}
|
||||
} elseif ([int]::TryParse($VisualStudioVersion, [ref]$refnum)) {
|
||||
$VisualStudioVersion="${refnum}.0"
|
||||
}
|
||||
# Check VisualStudioVersion and prepare for ToolsVersion
|
||||
switch ($VisualStudioVersion) {
|
||||
"10.0" { $tv = "4.0" }
|
||||
"11.0" { $tv = "4.0" }
|
||||
"12.0" { $tv = "12.0" }
|
||||
"14.0" { $tv = "14.0" }
|
||||
"15.0" { $tv = "15.0" }
|
||||
default { throw "Selected Visual Stuidio is Version ${VisualStudioVersion}. Please use VC10 or later"}
|
||||
}
|
||||
#
|
||||
# Determine ToolsVersion
|
||||
#
|
||||
if ("$MSToolsVersionv" -eq "") {
|
||||
$MSToolsVersionv=$env:ToolsVersion
|
||||
}
|
||||
if ("$MSToolsVersionv" -eq "") {
|
||||
$MSToolsVersionv = $tv
|
||||
[int]::TryParse($MSToolsVersionv, [ref]$refnum) | Out-Null
|
||||
if ("$MSToolsVersionv" -match "^(\d+)") {
|
||||
$refnum = $matches[1]
|
||||
}
|
||||
} elseif ([int]::TryParse($MSToolsVersionv, [ref]$refnum)) {
|
||||
$MSToolsVersionv="${refnum}.0"
|
||||
}
|
||||
#
|
||||
# Determine MSBuild executable
|
||||
#
|
||||
Write-Debug "ToolsVersion=$MSToolsVersionv VisualStudioVersion=$VisualStudioVersion"
|
||||
try {
|
||||
$msbver = msbuild.exe /ver /nologo
|
||||
if ("$msbver" -match "^(\d+)\.(\d+)") {
|
||||
$major1 = [int] $matches[1]
|
||||
$minor1 = [int] $matches[2]
|
||||
if ($MSToolsVersionv -match "^(\d+)\.(\d+)") {
|
||||
$bavail = $false
|
||||
$major2 = [int] $matches[1]
|
||||
$minor2 = [int] $matches[2]
|
||||
if ($major1 -gt $major2) {
|
||||
Write-Debug "$major1 > $major2"
|
||||
$bavail = $true
|
||||
}
|
||||
elseif ($major1 -eq $major2 -And $minor1 -ge $minor2) {
|
||||
Write-Debug "($major1, $minor1) >= ($major2, $minor2)"
|
||||
$bavail = $true
|
||||
}
|
||||
if ($bavail) {
|
||||
$msbuildexe = "MSBuild"
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
if ("$msbuildexe" -eq "") {
|
||||
if ([int]$refnum -gt 14) { # VC15 ~ VC??
|
||||
$msbuildexe = msbfind_15_xx $MSToolsVersionv
|
||||
} else { # VC10 ~ VC14
|
||||
$msbuildexe = msbfind_10_14 $MSToolsVersionv
|
||||
if ($refnum -eq 4) {
|
||||
if ((Find-VSDir $VisualStudioVersion) -eq "") {
|
||||
throw "MSBuild VisualStudioVersion $VisualStudioVersion not Found"
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("$msbuildexe" -eq "") {
|
||||
throw "MSBuild ToolsVersion $MSToolsVersionv not Found"
|
||||
}
|
||||
}
|
||||
#
|
||||
# Determine PlatformToolset
|
||||
#
|
||||
if (("$Toolsetv" -eq "") -And ($configInfo -ne $null)) {
|
||||
$Toolsetv=$configInfo.Configuration.toolset
|
||||
}
|
||||
if ("$Toolsetv" -eq "") {
|
||||
$Toolsetv=$env:PlatformToolset
|
||||
}
|
||||
if ("$Toolsetv" -eq "") {
|
||||
switch ($VisualStudioVersion) {
|
||||
"10.0" {
|
||||
if (Test-path "HKLM:\Software\Microsoft\Microsoft SDKs\Windows\v7.1") {
|
||||
$Toolsetv=$WSDK71Set
|
||||
} else {
|
||||
$Toolsetv="v100"
|
||||
}
|
||||
}
|
||||
"11.0" {$Toolsetv="v110_xp"}
|
||||
"12.0" {$Toolsetv="v120_xp"}
|
||||
"14.0" {$Toolsetv="v140_xp"}
|
||||
"15.0" {$Toolsetv="v141_xp"}
|
||||
}
|
||||
}
|
||||
# avoid a bug of Windows7.1SDK PlatformToolset
|
||||
if ($Toolsetv -eq $WSDK71Set) {
|
||||
$env:TARGET_CPU=""
|
||||
}
|
||||
#
|
||||
$VCVersion.value=$VisualStudioVersion
|
||||
$MSToolsVersion.value=$MSToolsVersionv
|
||||
$Toolset.value=$Toolsetv
|
||||
|
||||
return $msbuildexe
|
||||
}
|
||||
|
||||
# find msbuild.exe for VC10 ~ VC14
|
||||
function msbfind_10_14
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[string]$toolsver)
|
||||
|
||||
$msbindir=""
|
||||
$regKey="HKLM:\Software\Wow6432Node\Microsoft\MSBuild\ToolsVersions\${toolsver}"
|
||||
if (Test-Path -path $regkey) {
|
||||
$msbitem=Get-ItemProperty $regKey
|
||||
if ($msbitem -ne $null) {
|
||||
$msbindir=$msbitem.MSBuildToolsPath
|
||||
}
|
||||
} else {
|
||||
$regKey="HKLM:\Software\Microsoft\MSBuild\ToolsVersions\${toolsver}"
|
||||
if (Test-Path -path $regkey) {
|
||||
$msbitem=Get-ItemProperty $regKey
|
||||
if ($msbitem -ne $null) {
|
||||
$msbindir=$msbitem.MSBuildToolsPath
|
||||
}
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
return "${msbindir}msbuild"
|
||||
}
|
||||
|
||||
# find msbuild.exe for VC15 ~ VC??
|
||||
function msbfind_15_xx
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[string]$toolsver)
|
||||
|
||||
$vsdir = Find-VSDir $toolsver
|
||||
if ("$vsdir" -eq "") {
|
||||
return ""
|
||||
}
|
||||
return "${vsdir}MSBuild\$toolsver\Bin\MSBuild.exe"
|
||||
}
|
||||
|
||||
$dumpbinexe = ""
|
||||
$addPath=""
|
||||
|
||||
function Find-Dumpbin
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([int]$CurMaxVC = 15)
|
||||
|
||||
if ("$dumpbinexe" -ne "") {
|
||||
if ("$addPath" -ne "") {
|
||||
if (${env:PATH}.indexof($addPath) -lt 0) {
|
||||
$env:PATH = "${addPath};" + $env:PATH
|
||||
}
|
||||
}
|
||||
return $dumpbinexe
|
||||
}
|
||||
$addPath=""
|
||||
$vsdir=""
|
||||
try {
|
||||
$dum = dumpbin.exe /NOLOGO
|
||||
$dumpbinexe="dumpbin"
|
||||
} catch [Exception] {
|
||||
# $dumpbinexe="$env:DUMPBINEXE"
|
||||
if ($dumpbinexe -eq "") {
|
||||
$searching = $true
|
||||
for ($i = $CurMaxVc; $searching -and ($i -ge 14); $i--) # VC15 ~ VC??
|
||||
{
|
||||
$vsdir = Find-VSDir $i
|
||||
if ("$vsdir" -ne "") {
|
||||
$lslist = @(Get-ChildItem "${vsdir}VC\Tools\MSVC\*\bin\HostX86\x86\dumpbin.exe" -ErrorAction SilentlyContinue)
|
||||
if ($lslist.Count -gt 0) {
|
||||
$dumpbinexe=$lslist[0].FullName
|
||||
$searching = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
for (; $searching -and ($i -ge 10); $i--) # VC10 ~ VC14
|
||||
{
|
||||
$vsdir = Find-VSDir $i
|
||||
if ("$vsdir" -ne "") {
|
||||
$dumpbinexe="${vsdir}VC\bin\dumpbin.exe"
|
||||
if (Test-Path -Path $dumpbinexe) {
|
||||
$searching = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($searching) {
|
||||
throw "dumpbin doesn't exist"
|
||||
}
|
||||
elseif ($i -eq 10) {
|
||||
$addPath = "${vsdir}Common7\ide"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Dumpbin=$dumpbinexe"
|
||||
Set-Variable -Name dumpbinexe -Value $dumpbinexe -Scope 1
|
||||
Set-Variable -Name addPath -Value $addPath -Scope 1
|
||||
if ("$addPath" -ne "") {
|
||||
if (${env:PATH}.indexof($addPath) -lt 0) {
|
||||
$env:PATH = "${addPath};" + $env:PATH
|
||||
}
|
||||
}
|
||||
return $dumpbinexe
|
||||
}
|
||||
|
||||
function dumpbinRecurs
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[string]$dllname,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$dllfolder,
|
||||
[array]$instarray)
|
||||
|
||||
$tmem=& ${dumpbinexe} /imports "$dllfolder\${dllname}" | select-string -pattern "^\s*(\S*\.dll)" | foreach-object {$_.Matches.Groups[1].Value} | where-object {test-path ("${dllfolder}\" + $_)}
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to dumpbin ${dllfolder}\${dllname}"
|
||||
}
|
||||
if ($tmem -eq $Null) {
|
||||
return $instarray
|
||||
}
|
||||
if ($tmem.GetType().Name -eq "String") {
|
||||
[String []]$tarray = @($tmem)
|
||||
} else {
|
||||
$tarray = $tmem
|
||||
}
|
||||
$iarray=@()
|
||||
for ($i=0; $i -lt $tarray.length; $i++) {
|
||||
if (-not($instarray -contains $tarray[$i])) {
|
||||
$iarray += $tarray[$i]
|
||||
}
|
||||
}
|
||||
if ($iarray.length -eq 0) {
|
||||
return $instarray
|
||||
}
|
||||
$instarray += $iarray
|
||||
for ($i=0; $i -lt $iarray.length; $i++) {
|
||||
$instarray=dumpbinRecurs $iarray[$i] $dllfolder $instarray
|
||||
}
|
||||
return $instarray
|
||||
}
|
||||
|
||||
function Get-RelatedDlls
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[string]$dllname,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$dllfolder)
|
||||
|
||||
Find-Dumpbin | Out-Null
|
||||
$libpqmem=@()
|
||||
$libpqmem=dumpbinRecurs $dllname $dllfolder $libpqmem
|
||||
|
||||
return $libpqmem
|
||||
}
|
||||
|
||||
function env_vcversion_no()
|
||||
{
|
||||
$viver = $env:VisualStudioVersion
|
||||
if ("$viver" -ne "") {
|
||||
if ("$viver" -match "(\d+)\.0") {
|
||||
return [int]$matches[1]
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function Find-VSDir
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[string]$vcversion)
|
||||
|
||||
[int]$vcversion_no = [int]$vcversion
|
||||
if ("${vcversion}" -match "^(\d+)") {
|
||||
$vcversion_no = $matches[1]
|
||||
}
|
||||
if ((env_vcversion_no) -eq $vcversion_no) {
|
||||
return $env:VSINSTALLDIR
|
||||
}
|
||||
if ($vcversion_no -gt 14) { # VC15 ~ VC??
|
||||
return find_vsdir_15_xx ${vcversion_no}
|
||||
} else { # VC10 ~ VC14
|
||||
$comntools = [environment]::getenvironmentvariable("VS${vcversion_no}0COMNTOOLS")
|
||||
if ("$comntools" -eq "") {
|
||||
return ""
|
||||
}
|
||||
return (Split-Path (Split-Path $comntools -Parent) -Parent) + "\"
|
||||
}
|
||||
}
|
||||
|
||||
[bool]$vssetup_available = $true
|
||||
$vssetup = $null
|
||||
|
||||
# find VS dir for VC15 ~ VC??
|
||||
function find_vsdir_15_xx
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
||||
Param([Parameter(Mandatory=$true)]
|
||||
[string]$toolsver)
|
||||
|
||||
# vssetup module is available?
|
||||
if ($vssetup_available -and ($vsseup -eq $null)) {
|
||||
try {
|
||||
$vssetup = @(Get-VssetupInstance)
|
||||
} catch [Exception] {
|
||||
$vssetup_available = $false
|
||||
}
|
||||
}
|
||||
if ($vssetup -ne $null) {
|
||||
$toolsnum = [int]$toolsver
|
||||
$lslist = @($vssetup | where-object { $_.InstallationVersion.Major -eq $toolsnum } | foreach-object { $_.InstallationPath })
|
||||
if ($lslist.Count -gt 0) {
|
||||
return $lslist[0] + "\"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
# vssetup module is unavailable
|
||||
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
|
||||
$pgmfs = "$env:ProgramFiles"
|
||||
} else {
|
||||
$pgmfs = "${env:ProgramFiles(x86)}"
|
||||
}
|
||||
$lslist = @(Get-ChildItem "$pgmfs\Microsoft Visual Studio\*\*\MSBuild\$toolsver\Bin\MSBuild.exe" -ErrorAction SilentlyContinue)
|
||||
if ($lslist.Count -gt 0) {
|
||||
return (Split-Path (Split-Path (Split-Path (Split-Path $lslist[0].FullName -Parent) -Parent) -Parent) -Parent) + "\"
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
Export-ModuleMember -function Find-MSBuild, Find-Dumpbin, Get-RelatedDlls, Find-VSDir
|
178
winbuild/Psqlodbc-config.psm1
Normal file
178
winbuild/Psqlodbc-config.psm1
Normal file
@ -0,0 +1,178 @@
|
||||
$configurationXmlPath=""
|
||||
$configurationTemplatePath=""
|
||||
|
||||
function InitConfiguration([string]$savePath)
|
||||
{
|
||||
$configInfo = [xml](Get-Content $configurationTemplatePath)
|
||||
if ($env:PROCESSOR_ARCHITECTURE -eq "x86")
|
||||
{
|
||||
$x64info = $configInfo.Configuration.x64
|
||||
$x64info.libpq.include = ""
|
||||
$x64info.libpq.lib = ""
|
||||
$x64info.libpq.bin = ""
|
||||
}
|
||||
$configInfo.save($savePath)
|
||||
|
||||
return $configInfo
|
||||
}
|
||||
|
||||
function GetConfiguration([string]$loadPath)
|
||||
{
|
||||
$configInfo = [xml] (Get-Content $loadPath)
|
||||
set-variable -name xmlFormatVersion -value "0.4" -option constant
|
||||
if ($configInfo.Configuration.formatVersion -ne $xmlFormatVersion)
|
||||
{
|
||||
$xmlDoc2 = [xml](Get-Content $configurationTemplatePath)
|
||||
$root2 = $XmlDoc2.get_DocumentElement()
|
||||
$root1 = $configInfo.get_DocumentElement()
|
||||
unifyNodes $root1 $root2
|
||||
|
||||
$root1.formatVersion = $xmlFormatVersion
|
||||
$configInfo.save($loadPath)
|
||||
}
|
||||
|
||||
return $configInfo
|
||||
}
|
||||
|
||||
function LoadConfiguration([string]$configPath, [string]$configDir)
|
||||
{
|
||||
Write-Debug "configPath=$configPath"
|
||||
set-variable -name configurationTemplatePath -scope 1 -value "$configDir\configuration_template.xml"
|
||||
if ("$configPath" -eq "") {
|
||||
$configPath = "$configDir\configuration.xml"
|
||||
}
|
||||
set-variable -name configurationXmlPath -scope 1 -value $configPath
|
||||
if (!(Test-Path -path $configPath))
|
||||
{
|
||||
return InitConFiguration $configPath
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetConfiguration $configPath
|
||||
}
|
||||
}
|
||||
|
||||
function SaveConfiguration([xml]$configInfo, [string]$savePath)
|
||||
{
|
||||
if ("$savePath" -eq "") {
|
||||
$savePath = $configurationXmlPath
|
||||
}
|
||||
$configInfo.save($savePath)
|
||||
}
|
||||
|
||||
function unifyNodes($node1, $node2)
|
||||
{
|
||||
$attributes2 = $node2.get_Attributes()
|
||||
if ($attributes2.Count -gt 0)
|
||||
{
|
||||
$attributes1 = $node1.get_Attributes()
|
||||
foreach ($attrib in $attributes2)
|
||||
{
|
||||
$attribname = $attrib.name
|
||||
if (($attributes1.Count -eq 0) -or ($attributes1.GetNamedItem($attribname) -eq $null))
|
||||
{
|
||||
Write-Debug " Adding attribute=$attribname"
|
||||
$addattr = $node1.OwnerDocument.ImportNode($attrib, $true)
|
||||
$added = $attributes1.Append($addattr)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$node2.get_HasChildNodes()) {
|
||||
return;
|
||||
}
|
||||
foreach ($child2 in $node2.get_ChildNodes())
|
||||
{
|
||||
$nodename = $child2.get_Name()
|
||||
if ($nodename -eq "#text"){
|
||||
continue
|
||||
}
|
||||
$matchnode = $node1.SelectSingleNode($nodename)
|
||||
if ($matchnode -eq $null)
|
||||
{
|
||||
Write-Debug "Adding node=$nodename"
|
||||
$addnode = $node1.OwnerDocument.ImportNode($child2, $true)
|
||||
$added = $node1.AppendChild($addnode)
|
||||
continue
|
||||
}
|
||||
unifyNodes $matchnode $child2
|
||||
}
|
||||
}
|
||||
|
||||
function getPGDir([xml]$configInfo, [string]$Platform, [string]$kind)
|
||||
{
|
||||
if ($Platform -ieq "x64") {
|
||||
$platinfo=$configInfo.Configuration.x64
|
||||
} else {
|
||||
$platinfo=$configInfo.Configuration.x86
|
||||
}
|
||||
$LIBPQVER=$platinfo.libpq.version
|
||||
if ($kind -eq "include") {
|
||||
$result=$platinfo.libpq.include
|
||||
} elseif ($kind -eq "lib") {
|
||||
$result=$platinfo.libpq.lib
|
||||
} else {
|
||||
$result=$platinfo.libpq.bin
|
||||
}
|
||||
if ($result -ne "default") {
|
||||
return $result
|
||||
}
|
||||
if ($Platform -ieq "x64") {
|
||||
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
|
||||
$pgmfs = $env:ProgramW6432
|
||||
} else {
|
||||
$pgmfs = $env:ProgramFiles
|
||||
}
|
||||
} else {
|
||||
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
|
||||
$pgmfs = $env:ProgramFiles
|
||||
} else {
|
||||
$pgmfs = ${env:ProgramFiles(x86)}
|
||||
}
|
||||
}
|
||||
if ("$pgmfs" -eq "") {
|
||||
$result = $null
|
||||
} else {
|
||||
$lslist = $null
|
||||
$result = $null
|
||||
if (-not (Test-Path "$pgmfs\PostgreSQL")) {
|
||||
throw("default Postgres Directory not found`nPlease specify the directories other than default")
|
||||
}
|
||||
$lslist = @(Get-ChildItem "$pgmfs\PostgreSQL")
|
||||
if ($null -eq $lslist) {
|
||||
throw("default Postgres Directory not found")
|
||||
} else {
|
||||
[decimal]$vernum = 0
|
||||
if ("$LIBPQVER" -eq "") {
|
||||
foreach ($l in $lslist) {
|
||||
$ver = [decimal]$l.Name
|
||||
if ($ver -gt $vernum) {
|
||||
$result = $l.FullName + "\$kind"
|
||||
$vernum = $ver
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($l in $lslist) {
|
||||
if ($LIBPQVER -eq $l.Name) {
|
||||
$result = $l.FullName + "\$kind"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result
|
||||
}
|
||||
|
||||
function GetPackageVersion([xml]$configInfo, [string]$srcpath)
|
||||
{
|
||||
$version_no = $configInfo.Configuration.version
|
||||
if ("$version_no" -eq "") {
|
||||
pushd "$srcpath"
|
||||
$splitItem = Get-Content ".\version.h" | Where-Object {($_.IndexOf("#define") -ge 0) -and ($_.IndexOf("POSTGRESDRIVERVERSION") -ge 0) -and ($_.IndexOF("`"") -ge 0)} | ForEach-Object {$_.split("`"")}
|
||||
$version_no = $splitItem[1]
|
||||
popd
|
||||
}
|
||||
return $version_no
|
||||
}
|
||||
|
||||
Export-ModuleMember -function LoadConfiguration, SaveConfiguration, unifyNodes, getPGDir, getPackageVersion -variable LIBPQ_VERSION
|
96
winbuild/configuration.ps1
Normal file
96
winbuild/configuration.ps1
Normal file
@ -0,0 +1,96 @@
|
||||
Param(
|
||||
[string]$configPath
|
||||
)
|
||||
function InitConfiguration($savePath = $configurationXmlPath)
|
||||
{
|
||||
$configInfo = [xml](Get-Content "$configurationTemplatePath")
|
||||
if ($env:PROCESSOR_ARCHITECTURE -eq "x86")
|
||||
{
|
||||
$x64info = $configInfo.Configuration.x64
|
||||
$x64info.libpq.include = ""
|
||||
$x64info.libpq.lib = ""
|
||||
$x64info.libpq.bin = ""
|
||||
}
|
||||
$configInfo.save("$savePath")
|
||||
|
||||
return $configInfo
|
||||
}
|
||||
|
||||
function global:GetConfiguration($loadPath = $configurationXmlPath)
|
||||
{
|
||||
$configInfo = [xml] (Get-Content "$loadPath")
|
||||
set-variable -name xmlFormatVersion -value "0.4" -option constant
|
||||
if ($configInfo.Configuration.formatVersion -ne $xmlFormatVersion)
|
||||
{
|
||||
$xmlDoc2 = [xml](Get-Content "$configurationTemplatePath")
|
||||
$root2 = $XmlDoc2.get_DocumentElement()
|
||||
$root1 = $configInfo.get_DocumentElement()
|
||||
unifyNodes $root1 $root2
|
||||
|
||||
$root1.formatVersion = $xmlFormatVersion
|
||||
$configInfo.save("$loadPath")
|
||||
}
|
||||
|
||||
return $configInfo
|
||||
}
|
||||
|
||||
function global:SaveConfiguration($configInfo, $savePath = $configurationXmlPath)
|
||||
{
|
||||
$configInfo.save("$savePath")
|
||||
}
|
||||
|
||||
function global:unifyNodes($node1, $node2)
|
||||
{
|
||||
$attributes2 = $node2.get_Attributes()
|
||||
if ($attributes2.Count -gt 0)
|
||||
{
|
||||
$attributes1 = $node1.get_Attributes()
|
||||
foreach ($attrib in $attributes2)
|
||||
{
|
||||
$attribname = $attrib.name
|
||||
if (($attributes1.Count -eq 0) -or ($attributes1.GetNamedItem($attribname) -eq $null))
|
||||
{
|
||||
Write-Debug " Adding attribute=$attribname"
|
||||
$addattr = $node1.OwnerDocument.ImportNode($attrib, $true)
|
||||
$added = $attributes1.Append($addattr)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$node2.get_HasChildNodes()) {
|
||||
return;
|
||||
}
|
||||
foreach ($child2 in $node2.get_ChildNodes())
|
||||
{
|
||||
$nodename = $child2.get_Name()
|
||||
if ($nodename -eq "#text"){
|
||||
continue
|
||||
}
|
||||
$matchnode = $node1.SelectSingleNode($nodename)
|
||||
if ($matchnode -eq $null)
|
||||
{
|
||||
Write-Debug "Adding node=$nodename"
|
||||
$addnode = $node1.OwnerDocument.ImportNode($child2, $true)
|
||||
$added = $node1.AppendChild($addnode)
|
||||
continue
|
||||
}
|
||||
unifyNodes $matchnode $child2
|
||||
}
|
||||
}
|
||||
|
||||
Write-Debug "configPath=$configPath"
|
||||
$global:LIBPQ_VERSION="9.3"
|
||||
$scriptPath = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)
|
||||
$global:configurationTemplatePath = "$scriptPath\configuration_template.xml"
|
||||
$global:configurationXmlPath = $configPath
|
||||
if ($configurationXmlPath -eq "") {
|
||||
$global:configurationXmlPath = "$scriptPath\configuration.xml"
|
||||
}
|
||||
if (!(Test-Path -path $configurationXmlPath))
|
||||
{
|
||||
InitConfiguration
|
||||
}
|
||||
else
|
||||
{
|
||||
GetConfiguration
|
||||
}
|
||||
Return
|
31
winbuild/configuration_template.xml
Normal file
31
winbuild/configuration_template.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration version="" formatVersion="0.4" vcversion="" toolset="">
|
||||
<title></title>
|
||||
<x86 disabled="no">
|
||||
<libpq version="">
|
||||
<include>default</include>
|
||||
<lib>default</lib>
|
||||
<bin>default</bin>
|
||||
</libpq>
|
||||
<setvcvars></setvcvars>
|
||||
<build_macros></build_macros>
|
||||
<runtime_folder></runtime_folder>
|
||||
</x86>
|
||||
<x64>
|
||||
<libpq version="">
|
||||
<include>default</include>
|
||||
<lib>default</lib>
|
||||
<bin>default</bin>
|
||||
</libpq>
|
||||
<setvcvars></setvcvars>
|
||||
<build_macros></build_macros>
|
||||
<runtime_folder></runtime_folder>
|
||||
</x64>
|
||||
<BuildResult>
|
||||
<Date></Date>
|
||||
<VisualStudioVersion></VisualStudioVersion>
|
||||
<PlatformToolset></PlatformToolset>
|
||||
<ToolsVersion></ToolsVersion>
|
||||
<Platform></Platform>
|
||||
</BuildResult>
|
||||
</Configuration>
|
202
winbuild/editConfiguration.ps1
Normal file
202
winbuild/editConfiguration.ps1
Normal file
@ -0,0 +1,202 @@
|
||||
# Powershell needs to run in STA mode to display WPF windows
|
||||
Param(
|
||||
[string]$configPath
|
||||
)
|
||||
if ([Threading.Thread]::CurrentThread.GetApartmentState() -eq "MTA"){
|
||||
PowerShell -Sta -File $MyInvocation.MyCommand.Path
|
||||
return
|
||||
}
|
||||
|
||||
<#
|
||||
Edit the configuration xnl file with WPF
|
||||
#>
|
||||
|
||||
Add-Type -AssemblyName presentationframework
|
||||
|
||||
[xml]$XAML = @'
|
||||
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="MainWindow" Height="470" Width="539" BorderBrush="Black" Margin="30,0,0,0">
|
||||
<Grid>
|
||||
<StackPanel Height="600" HorizontalAlignment="Left" Margin="42,29,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="431" Opacity="1">
|
||||
<StackPanel Orientation="Horizontal" Height="50">
|
||||
<Label Content="Windows Build Configuration" Height="28" Name="label25" Margin="30,0,0,0" />
|
||||
<Button Content="save" Height="23" Name="buttonSave" Width="75" Margin="30,0,0,0" />
|
||||
<Button Content="end" Height="23" Name="buttonEnd" Width="75" Margin="30,0,0,0" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Height="30" Width="Auto">
|
||||
<Label Content="version" Height="28" Name="labelVersion" HorizontalAlignment="Left" />
|
||||
<TextBox Height="24" Name="versionBox" HorizontalAlignment="Left" Width="100" />
|
||||
<Label Content="vcversion" Height="28" Name="labelVcversion" HorizontalAlignment="Left" />
|
||||
<TextBox Height="24" Name="vcversionBox" HorizontalAlignment="Left" Width="50" />
|
||||
<Label Content="toolset" Height="28" Name="labelToolset" HorizontalAlignment="Left" />
|
||||
<TextBox Height="24" Name="toolsetBox" HorizontalAlignment="Left" Width="50" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="x86" Height="26" Name="label1" Width="43" HorizontalContentAlignment="Center" HorizontalAlignment="Left" VerticalAlignment="Top" />
|
||||
<TextBox Height="Auto" Name="versionBox1" Width="30" />
|
||||
</StackPanel>
|
||||
<StackPanel Height="78" Name="stackPanel2" Width="Auto" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Label Content="libpq" Height="Auto" HorizontalContentAlignment="Center" Name="label2" VerticalContentAlignment="Center" Width="51" BorderBrush="Black" BorderThickness="1,1,0,0" />
|
||||
<StackPanel Height="Auto" Name="stackPanel3" Width="380">
|
||||
<StackPanel Height="26" Name="stackPanel4" Width="Auto" Orientation="Horizontal">
|
||||
<Label Content="include" Height="Auto" Name="label3" Width="56" BorderThickness="1,1,1,0" BorderBrush="Black" />
|
||||
<TextBox Height="24" Name="textBox1" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button1" Width="20" />
|
||||
</StackPanel>
|
||||
<StackPanel Height="26" Name="stackPanel5" Width="Auto" Orientation="Horizontal">
|
||||
<Label Content="lib " Height="Auto" Name="label4" Width="56" BorderBrush="Black" BorderThickness="1,1,1,0" />
|
||||
<TextBox Height="24" Name="textBox2" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button2" Width="20" />
|
||||
</StackPanel>
|
||||
<StackPanel Height="26" Name="stackPanel6" Width="Auto" Orientation="Horizontal">
|
||||
<Label Content="bin " Height="Auto" Name="label5" Width="56" BorderBrush="Black" BorderThickness="1,1,1,0" />
|
||||
<TextBox Height="25" Name="textBox3" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button3" Width="20" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!-- x86.build_macros -->
|
||||
<StackPanel Height="26" Name="stackPanel86vcvars" Orientation="Horizontal" Width="Auto">
|
||||
<Label BorderBrush="Black" Content="build__macros" Height="Auto" HorizontalContentAlignment="Center" Name="label86vcvars" VerticalContentAlignment="Center" Width="107" BorderThickness="1,0,1,1" />
|
||||
<StackPanel Height="Auto" Name="stackPanel86vcvars_1" Orientation="Horizontal" Width="Auto">
|
||||
<TextBox Height="24" Name="textBox86vcvars" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button86vcvars" Width="20" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!-- x64 -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="x64" Height="26" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Name="label13" VerticalAlignment="Top" Width="43" />
|
||||
<TextBox Height="Auto" Name="versionBox2" Width="30" />
|
||||
</StackPanel>
|
||||
<StackPanel Height="78" Name="stackPanel16" Orientation="Horizontal" Width="Auto">
|
||||
<Label BorderBrush="Black" Content="libpq" Height="Auto" HorizontalContentAlignment="Center" Name="label14" VerticalContentAlignment="Center" Width="51" BorderThickness="1,1,0,0" />
|
||||
<StackPanel Height="Auto" Name="stackPanel17" Width="380">
|
||||
<StackPanel Height="26" Name="stackPanel18" Orientation="Horizontal" Width="Auto">
|
||||
<Label Content="include" Height="Auto" Name="label15" Width="56" BorderThickness="1,1,1,0" BorderBrush="Black" />
|
||||
<TextBox Height="24" Name="textBox9" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button9" Width="20" />
|
||||
</StackPanel>
|
||||
<StackPanel Height="26" Name="stackPanel19" Orientation="Horizontal" Width="Auto">
|
||||
<Label BorderBrush="Black" Content="lib " Height="Auto" Name="label16" Width="56" BorderThickness="1,1,1,0" />
|
||||
<TextBox Height="24" Name="textBox10" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button10" Width="20" />
|
||||
</StackPanel>
|
||||
<StackPanel Height="26" Name="stackPanel20" Orientation="Horizontal" Width="Auto">
|
||||
<Label BorderBrush="Black" Content="bin " Height="Auto" Name="label17" Width="56" BorderThickness="1,1,1,0" />
|
||||
<TextBox Height="25" Name="textBox11" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button11" Width="20" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<!-- x64.build_macros -->
|
||||
<StackPanel Height="26" Name="stackPanel64vcvars" Orientation="Horizontal" Width="Auto">
|
||||
<Label BorderBrush="Black" Content="build__macros" Height="Auto" HorizontalContentAlignment="Center" Name="label64vcvars" VerticalContentAlignment="Center" Width="107" BorderThickness="1,0,1,1" />
|
||||
<StackPanel Height="Auto" Name="stackPanel64vcvars_1" Orientation="Horizontal" Width="Auto">
|
||||
<TextBox Height="24" Name="textBox64vcvars" Width="304" />
|
||||
<Button Content="..." Height="23" Name="button64vcvars" Width="20" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
'@
|
||||
|
||||
$reader=(New-Object System.Xml.XmlNodeReader $xaml)
|
||||
$window=[Windows.Markup.XamlReader]::Load( $reader )
|
||||
|
||||
$buttonEnd = $window.FindName("buttonEnd")
|
||||
$buttonEnd_clicked = $buttonEnd.add_Click
|
||||
$buttonEnd_clicked.Invoke({
|
||||
Remove-Module Psqlodbc-config
|
||||
$window.close()
|
||||
})
|
||||
|
||||
$button_click =
|
||||
{
|
||||
($sender, $e) = $this, $_
|
||||
# sender�i$this�j
|
||||
[void] [Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
|
||||
$d = New-Object Windows.Forms.FolderBrowserDialog
|
||||
if ($d.ShowDialog() -eq "OK") {
|
||||
$lname = $sender.Name.substring(6)
|
||||
$text = $window.FindName("textBox" + $lname)
|
||||
$text.Text = $d.SelectedPath
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 1; $i -lt 17; $i++)
|
||||
{
|
||||
$button = $window.FindName("button" + $i)
|
||||
if ($button)
|
||||
{
|
||||
$button.add_Click($button_click)
|
||||
}
|
||||
}
|
||||
|
||||
$button_click2 =
|
||||
{
|
||||
($sender, $e) = $this, $_
|
||||
# sender�i$this�j
|
||||
[void] [Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
|
||||
$d = New-Object Windows.Forms.OpenFileDialog
|
||||
$d.InitialDirectory = $scriptPath
|
||||
if ($d.ShowDialog() -eq "OK") {
|
||||
$lname = $sender.Name.substring(6)
|
||||
$text = $window.FindName("textBox" + $lname)
|
||||
$text.Text = $d.FileName
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($btnname in ("button86vcvars", "button64vcvars"))
|
||||
{
|
||||
$button = $window.FindName($btnname)
|
||||
$button.add_Click($button_click2)
|
||||
}
|
||||
|
||||
$scriptPath = (Split-Path $MyInvocation.MyCommand.Path)
|
||||
Import-Module "$scriptPath\Psqlodbc-config.psm1"
|
||||
$configInfo = LoadConfiguration $configPath $scriptPath
|
||||
|
||||
$window.findName("versionBox").Text = $configInfo.Configuration.version
|
||||
$window.findName("vcversionBox").Text = $configInfo.Configuration.vcversion
|
||||
$window.findName("toolsetBox").Text = $configInfo.Configuration.toolset
|
||||
|
||||
$x86info = $configInfo.Configuration.x86
|
||||
$window.findName("versionBox1").Text = $x86info.libpq.version
|
||||
$window.findName("textBox1").Text = $x86info.libpq.include
|
||||
$window.findName("textBox2").Text = $x86info.libpq.lib
|
||||
$window.findName("textBox3").Text = $x86info.libpq.bin
|
||||
$window.findName("textBox86vcvars").Text = $x86info.build_macros
|
||||
|
||||
$x64info = $configInfo.Configuration.x64
|
||||
|
||||
$window.findName("versionBox2").Text = $x64info.libpq.version
|
||||
$window.findName("textBox9").Text = $x64info.libpq.include
|
||||
$window.findName("textBox10").Text = $x64info.libpq.lib
|
||||
$window.findName("textBox11").Text = $x64info.libpq.bin
|
||||
$window.findName("textBox64vcvars").Text = $x64info.build_macros
|
||||
|
||||
$buttonSave = $window.FindName("buttonSave")
|
||||
$buttonSave_clicked = $buttonSave.add_Click
|
||||
$buttonSave_clicked.Invoke({
|
||||
$configInfo.Configuration.version = $window.findName("versionBox").Text
|
||||
$configInfo.Configuration.vcversion = $window.findName("vcversionBox").Text
|
||||
$configInfo.Configuration.toolset = $window.findName("toolsetBox").Text
|
||||
$x86info.libpq.version = $window.findName("versionBox1").Text
|
||||
$x86info.libpq.include = $window.findName("textBox1").Text
|
||||
$x86info.libpq.lib = $window.findName("textBox2").Text
|
||||
$x86info.libpq.bin = $window.findName("textBox3").Text
|
||||
$x86info.build_macros = $window.findName("textBox86vcvars").Text
|
||||
|
||||
$x64info.libpq.version = $window.findName("versionBox2").Text
|
||||
$x64info.libpq.include = $window.findName("textBox9").Text
|
||||
$x64info.libpq.lib = $window.findName("textBox10").Text
|
||||
$x64info.libpq.bin = $window.findName("textBox11").Text
|
||||
$x64info.build_macros = $window.findName("textBox64vcvars").Text
|
||||
|
||||
SaveConfiguration $configInfo
|
||||
})
|
||||
|
||||
$window.ShowDialog() | out-null
|
222
winbuild/pgenlist.vcxproj
Normal file
222
winbuild/pgenlist.vcxproj
Normal file
@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DFD90C9A-E9BA-4CA3-812B-E820EE9A3F5B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>pgenlist</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<GenerateImportLib>true</GenerateImportLib>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<GenerateImportLib>true</GenerateImportLib>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<GenerateImportLib>true</GenerateImportLib>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<GenerateImportLib>true</GenerateImportLib>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" >
|
||||
<ANSI_VERSION>no</ANSI_VERSION>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'=='yes'">
|
||||
<TargetName>pgenlista</TargetName>
|
||||
<TargetType>ANSI</TargetType>
|
||||
<DriverName>psqlodbc30a</DriverName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'!='yes'">
|
||||
<TargetName>pgenlist</TargetName>
|
||||
<TargetType>Unicode</TargetType>
|
||||
<DriverName>psqlodbc35w</DriverName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)'=='Win32'">
|
||||
<TARGET_CPU>x86</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'!='Win32'">
|
||||
<TARGET_CPU>x64</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IntDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\pgenlist\</IntDir>
|
||||
<OutDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="psqlodbc.Cpp.props" />
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>XOLEHLP.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>xolehlp.lib;$(Drivername).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>XOLEHLP.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>xolehlp.lib;$(Drivername).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>XOLEHLP.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>xolehlp.lib;$(DriverName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>XOLEHLP.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>xolehlp.lib;$(Drivername).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(GenerateImportLib)'=='true'">
|
||||
<Link>
|
||||
<ModuleDefinitionFile></ModuleDefinitionFile>
|
||||
<AdditionalDependencies>$(TargetName).exp;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(srcPath)msdtc_enlist.cpp" />
|
||||
<ClCompile Include="$(srcPath)xalibname.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
34
winbuild/pguser.Cpp.props
Normal file
34
winbuild/pguser.Cpp.props
Normal file
@ -0,0 +1,34 @@
|
||||
<!--
|
||||
***********************************************************************************************
|
||||
pguser.Cpp.props
|
||||
|
||||
This project property sheet is to avoid a crash in the following case.
|
||||
|
||||
1. Windows SDK 7.1 is installed
|
||||
2. Visual C++ (Express) 10 not installed
|
||||
3. Platformtoolset is Windows7.1SDK or v100
|
||||
4. Normal (non-C++ or SDK) Command prompt
|
||||
|
||||
Unfortunately the property VSInstallDir wasn't determined because
|
||||
of the above #2. Here we derive it from $(VCInstallDir) by removing
|
||||
the last 3 characters 'VC\'. Then we prepend
|
||||
$(VSInstallDir)Common7\ide and $(VSInstallDir)Common7\tools
|
||||
to the ExecutablePath property unless $(ExecutablePath) contains them.
|
||||
|
||||
Added library legacy_stdio_definitions.lib for vc14 or later.
|
||||
***********************************************************************************************
|
||||
-->
|
||||
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- PropertyGroup -->
|
||||
<PropertyGroup Condition="'$(VSInstallDir)'=='' And '$(VCInstallDir)'!='' And ('$(PlatformToolset)'=='v100' Or '$(PlatformToolset)'=='Windows7.1SDK')">
|
||||
<VSInstallDir>$(VCInstallDir.Substring(0, $([MSBuild]::Subtract($(VCInstallDir.length),3))))</VSInstallDir>
|
||||
<VSIdePath>$(VSInstallDir)Common7\ide</VSIdePath>
|
||||
<ExecutablePath Condition="!$(ExecutablePath.ToLower().Contains($(VSIdePath.ToLower())))">$(VSIdePath);$(VSInstallDir)Common7\Tools;$(ExecutablePath)</ExecutablePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(PlatformToolset.Substring(1,1))'=='1'AND($(PlatformToolset.Substring(2,1).CompareTo('3'))>0)">
|
||||
<Link>
|
||||
<AdditionalDependencies>legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
180
winbuild/pgxalib.vcxproj
Normal file
180
winbuild/pgxalib.vcxproj
Normal file
@ -0,0 +1,180 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{27D21217-BD79-4A0A-80C4-EE87C57D423F}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>pgxalib</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup>
|
||||
<TargetName>pgxalib</TargetName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'=='yes'">
|
||||
<TargetType>ANSI</TargetType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'!='yes'">
|
||||
<TargetType>Unicode</TargetType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)'=='Win32'">
|
||||
<TARGET_CPU>x86</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'!='Win32'">
|
||||
<TARGET_CPU>x64</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IntDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\pgxalib\</IntDir>
|
||||
<OutDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="psqlodbc.Cpp.props" />
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(srcPath)pgxalib.cpp" />
|
||||
<ClCompile Include="$(srcPath)xalibname.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
121
winbuild/platformbuild.vcxproj
Normal file
121
winbuild/platformbuild.vcxproj
Normal file
@ -0,0 +1,121 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<StopOnFirstFailure>true</StopOnFirstFailure>
|
||||
<BuildInPararell>false</BuildInPararell>
|
||||
<Configuration>Release</Configuration>
|
||||
<srcPath>..\</srcPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectToBuild Include="psqlodbc.vcxproj">
|
||||
</ProjectToBuild>
|
||||
<ProjectToBuild Include="pgenlist.vcxproj">
|
||||
</ProjectToBuild>
|
||||
<ProjectToBuild Include="psqlodbc.vcxproj">
|
||||
<AdditionalProperties>ANSI_VERSION=yes
|
||||
</AdditionalProperties>
|
||||
</ProjectToBuild>
|
||||
<ProjectToBuild Include="pgenlist.vcxproj">
|
||||
<AdditionalProperties>ANSI_VERSION=yes
|
||||
</AdditionalProperties>
|
||||
</ProjectToBuild>
|
||||
<ProjectToBuild Include="pgxalib.vcxproj">
|
||||
</ProjectToBuild>
|
||||
<ProjectToBuild Include="psqlsetup.vcxproj">
|
||||
</ProjectToBuild>
|
||||
<ProjectToBuild Include="psqlsetup.vcxproj">
|
||||
<AdditionalProperties>ANSI_VERSION=yes
|
||||
</AdditionalProperties>
|
||||
</ProjectToBuild>
|
||||
</ItemGroup>
|
||||
<Target Name="Build">
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="BuildCompile"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Lib"/>
|
||||
<MSBuild Projects="psqlodbc.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Link"/>
|
||||
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="BuildCompile"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Lib"/>
|
||||
<MSBuild Projects="psqlodbc.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Link"/>
|
||||
<MSBuild Projects="pgxalib.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
|
||||
<Error
|
||||
Text="PG_BIN isn't set%0D%0Acoudn't build psqlsetup."
|
||||
Condition="'$PG_BIN)'==''"/>
|
||||
<Error
|
||||
Text="directory $(PG_BIN) doesn't exist.%0D%0Aset PG_BIN properly."
|
||||
Condition="!exists('$(PG_BIN)')"/>
|
||||
<Error
|
||||
Text="$(PG_BIN)\libpq.dll doesn't exist.%0D%0Aset PG_BIN properly."
|
||||
Condition="!exists('$(PG_BIN)\libpq.dll')"/>
|
||||
|
||||
<MSBuild Projects="psqlsetup.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="psqlsetup.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
</Target>
|
||||
<Target Name="Rebuild">
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="Clean;BuildCompile"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath);ImpLibForward=true"/>
|
||||
<MSBuild Projects="psqlodbc.vcxproj"
|
||||
Targets="ReBuild"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="Clean;BuildCompile"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath);ImpLibForward=true"/>
|
||||
<MSBuild Projects="psqlodbc.vcxproj"
|
||||
Targets="ReBuild"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="pgenlist.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="pgxalib.vcxproj"
|
||||
Targets="ReBuild"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
|
||||
<Error
|
||||
Text="PG_BIN isn't set%0D%0Acoudn't build psqlsetup."
|
||||
Condition="'$PG_BIN)'==''"/>
|
||||
<Error
|
||||
Text="directory $(PG_BIN) doesn't exist.%0D%0Aset PG_BIN properly."
|
||||
Condition="!exists('$(PG_BIN)')"/>
|
||||
<Error
|
||||
Text="$(PG_BIN)\libpq.dll doesn't exist.%0D%0Aset PG_BIN properly."
|
||||
Condition="!exists('$(PG_BIN)\llibpq.dll')"/>
|
||||
<MSBuild Projects="psqlsetup.vcxproj"
|
||||
Targets="ReBuild"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
<MSBuild Projects="psqlsetup.vcxproj"
|
||||
Targets="ReBuild"
|
||||
Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
</Target>
|
||||
<Target Name="Clean">
|
||||
<MSBuild Projects="@(ProjectToBuild)"
|
||||
Targets="Clean"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
</Target>
|
||||
<Target Name="Info">
|
||||
<MSBuild Projects="@(ProjectToBuild)"
|
||||
Targets="Info"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
</Target>
|
||||
</Project>
|
95
winbuild/psqlodbc.Cpp.props
Normal file
95
winbuild/psqlodbc.Cpp.props
Normal file
@ -0,0 +1,95 @@
|
||||
<!--
|
||||
***********************************************************************************************
|
||||
psqlodbc.Cpp.props
|
||||
|
||||
***********************************************************************************************
|
||||
-->
|
||||
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- -->
|
||||
<Import Project="pguser.Cpp.props" />
|
||||
<PropertyGroup Condition="'$(Platform)'=='Win32'">
|
||||
<WarnLvl>Level3</WarnLvl>
|
||||
<DSpcWarn>4018</DSpcWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'=='x64'">
|
||||
<WarnLvl>Level3</WarnLvl>
|
||||
<DSpcWarn>4018</DSpcWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(DRIVERVERSION)'!=''" >
|
||||
<ADD_DEFINES>$(ADD_DEFINES);POSTGRESDRIVERVERSION="$(DRIVERVERSION)"</ADD_DEFINES>
|
||||
<RSC_DEFINES>$(RSC_DEFINES);PG_DRVFILE_VERSION=$(DRIVERVERSION.substring(0, 2)),$(DRIVERVERSION.substring(3,2)),$(DRIVERVERSION.substring(6, 2)),$(DRIVERVERSION.substring(8, 2));POSTGRES_RESOURCE_VERSION=\"$(DRIVERVERSION)\"</RSC_DEFINES>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>$(WarnLvl)</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PrecompiledHeaderFile />
|
||||
<DisableSpecificWarnings>$(DSpcWarn)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>$(srcPath)$(TargetName).def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>$(WarnLvl)</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PrecompiledHeaderFile />
|
||||
<DisableSpecificWarnings>$(DSpcWarn)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>$(srcPath)$(TargetName).def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>$(WarnLvl)</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PrecompiledHeaderFile />
|
||||
<DisableSpecificWarnings>$(DSpcWarn)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>$(srcPath)$(TargetName).def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>$(WarnLvl)</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PrecompiledHeaderFile />
|
||||
<DisableSpecificWarnings>$(DSpcWarn)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>$(srcPath)$(TargetName).def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
274
winbuild/psqlodbc.vcxproj
Normal file
274
winbuild/psqlodbc.vcxproj
Normal file
@ -0,0 +1,274 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{79F872B5-9FAF-43DF-B441-9C860EAE52CF}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>psqlodbc</RootNamespace>
|
||||
<ProjectName>psqlodbc</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<!-- -->
|
||||
<PropertyGroup Label="UserMacros" >
|
||||
<ANSI_VERSION>no</ANSI_VERSION>
|
||||
<!-- -->
|
||||
<PG_INC></PG_INC>
|
||||
<PG_LIB></PG_LIB>
|
||||
<!-- -->
|
||||
<MSDTC>yes</MSDTC>
|
||||
<MEMORY_DEBUG>no</MEMORY_DEBUG>
|
||||
<!-- work properties -->
|
||||
<ADD_DEFINES></ADD_DEFINES>
|
||||
<ADD_INC></ADD_INC>
|
||||
<ADD_LIBPATH></ADD_LIBPATH>
|
||||
<RSC_DEFINES></RSC_DEFINES>
|
||||
<DELAY_LOAD_DLLS>secur32.dll</DELAY_LOAD_DLLS>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(PG_INC)'!=''">
|
||||
<ADD_INC>$(ADD_INC);$(PG_INC);$(PG_INC)/internal;$(PG_INC)/server;$(PG_INC)/server/port/win32</ADD_INC>
|
||||
<ADD_LIBPATH>$(ADD_LIBPATH);$(PG_LIB)</ADD_LIBPATH>
|
||||
<ADD_DEFINES>$(ADD_DEFINES)</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'=='yes'">
|
||||
<TargetName>psqlodbc30a</TargetName>
|
||||
<TargetType>ANSI</TargetType>
|
||||
<MAINDEF>$(srcPath)psqlodbca.def</MAINDEF>
|
||||
<DTCDLL>pgenlista</DTCDLL>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'!='yes'">
|
||||
<TargetName>psqlodbc35w</TargetName>
|
||||
<TargetType>Unicode</TargetType>
|
||||
<MAINDEF>$(srcPath)psqlodbc.def</MAINDEF>
|
||||
<DTCDLL>pgenlist</DTCDLL>
|
||||
<ADD_DEFINES>UNICODE_SUPPORT;UNICODE_SUPPORTXX</ADD_DEFINES>
|
||||
<RSC_DEFINES>UNICODE_SUPPORT</RSC_DEFINES>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)'=='Win32'">
|
||||
<TARGET_CPU>x86</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'!='Win32'">
|
||||
<TARGET_CPU>x64</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IntDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\</IntDir>
|
||||
<OutDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Import Project="std_dbmsname.Cpp.props" /-->
|
||||
|
||||
<PropertyGroup Condition="'$(MSDTC)'=='yes'">
|
||||
<ADD_DEFINES>$(ADD_DEFINES);_HANDLE_ENLIST_IN_DTC_</ADD_DEFINES>
|
||||
<DELAY_LOAD_DLLS>$(DELAY_LOAD_DLLS);$(DTCDLL).dll</DELAY_LOAD_DLLS>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
|
||||
</PropertyGroup>
|
||||
<!-- MEMORY_DEBUG -->
|
||||
<PropertyGroup Condition="'$(MEMORY_DEBUG)'=='yes'" >
|
||||
<ADD_DEFINES>$(ADD_DEFINES);_MEMORY_DEBUG_</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="psqlodbc.Cpp.props" />
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;$(ADD_DEFINES);DYNAMIC_LOAD;WIN_MULTITHREAD_SUPPORT;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ADD_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalLibraryDirectories>$(ADD_LIBPATH);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpq.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;wsock32.lib;ws2_32.lib;secur32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>$(MAINDEF)</ModuleDefinitionFile>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>lib /def:$(srcPath)$(DTCDLL).def /machine:x86 /out:"$(outDir)\$(DTCLDLL).lib"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;$(ADD_DEFINES);DYNAMIC_LOAD;WIN_MULTITHREAD_SUPPORT;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ADD_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalLibraryDirectories>$(ADD_LIBPATH);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpq.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;wsock32.lib;ws2_32.lib;secur32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>$(MAINDEF)</ModuleDefinitionFile>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>lib /def:$(srcPath)$(DTCDLL).def /machine:x64 /out:"$(outDir)\$(DTCLDLL).lib"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;$(ADD_DEFINES);DYNAMIC_LOAD;WIN_MULTITHREAD_SUPPORT;WIN32;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ADD_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalLibraryDirectories>$(ADD_LIBPATH);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpq.lib;winmm.lib;wsock32.lib;ws2_32.lib;secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>$(MAINDEF)</ModuleDefinitionFile>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>lib /def:$(srcPath)$(DTCDLL).def /machine:x86 /out:"$(outDir)\$(DTCDLL).lib"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;$(ADD_DEFINES);DYNAMIC_LOAD;WIN_MULTITHREAD_SUPPORT;WIN32;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ADD_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalLibraryDirectories>$(ADD_LIBPATH);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libpq.lib;winmm.lib;wsock32.lib;ws2_32.lib;secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>$(MAINDEF)</ModuleDefinitionFile>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>lib /def:$(srcPath)$(DTCDLL).def /machine:x64 /out:"$(outDir)\$(DTCDLL).lib"</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="catfunc.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(srcPath)bind.c" />
|
||||
<ClCompile Include="$(srcPath)columninfo.c" />
|
||||
<ClCompile Include="$(srcPath)connection.c" />
|
||||
<ClCompile Include="$(srcPath)convert.c" />
|
||||
<ClCompile Include="$(srcPath)descriptor.c" />
|
||||
<ClCompile Include="$(srcPath)dlg_specific.c" />
|
||||
<ClCompile Include="$(srcPath)dlg_wingui.c" />
|
||||
<ClCompile Include="$(srcPath)drvconn.c" />
|
||||
<ClCompile Include="$(srcPath)environ.c" />
|
||||
<ClCompile Include="$(srcPath)execute.c" />
|
||||
<ClCompile Include="$(srcPath)info.c" />
|
||||
<ClCompile Condition="'$(MEMORY_DEBUG)'=='yes'" Include="$(srcPath)inouealc.c" />
|
||||
<ClCompile Include="$(srcPath)loadlib.c" />
|
||||
<ClCompile Include="$(srcPath)lobj.c" />
|
||||
<ClCompile Include="$(srcPath)misc.c" />
|
||||
<ClCompile Include="$(srcPath)multibyte.c" />
|
||||
<ClCompile Include="$(srcPath)mylog.c" />
|
||||
<ClCompile Include="$(srcPath)odbcapi.c" />
|
||||
<ClCompile Include="$(srcPath)odbcapi30.c" />
|
||||
<ClCompile Condition="'$(ANSI_VERSION)'=='no'" Include="$(srcPath)odbcapi30w.c" />
|
||||
<ClCompile Condition="'$(ANSI_VERSION)'=='no'" Include="$(srcPath)odbcapiw.c" />
|
||||
<ClCompile Include="$(srcPath)options.c" />
|
||||
<ClCompile Include="$(srcPath)parse.c" />
|
||||
<ClCompile Include="$(srcPath)pgapi30.c" />
|
||||
<ClCompile Include="$(srcPath)pgtypes.c" />
|
||||
<ClCompile Include="$(srcPath)psqlodbc.c" />
|
||||
<ClCompile Include="$(srcPath)qresult.c" />
|
||||
<ClCompile Include="$(srcPath)results.c" />
|
||||
<ClCompile Include="$(srcPath)setup.c" />
|
||||
<ClCompile Include="$(srcPath)statement.c" />
|
||||
<ClCompile Include="$(srcPath)tuple.c" />
|
||||
<ClCompile Condition="'$(ANSI_VERSION)'=='no'" Include="$(srcPath)win_unicode.c" />
|
||||
<ClCompile Condition="'$(MSDTC)'=='yes'" Include="$(srcPath)xalibname.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="$(srcPath)psqlodbc.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<Target Name="Info">
|
||||
<Message Text="VCInstallDir=$(VCInstallDir) VSInstallDir=$(VSInstallDir) ExecutablePath=$(ExecutablePath)" />
|
||||
</Target>
|
||||
</Project>
|
275
winbuild/psqlsetup.vcxproj
Normal file
275
winbuild/psqlsetup.vcxproj
Normal file
@ -0,0 +1,275 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DFD90C9A-E9BA-4CA3-812B-E820EE9A3F5B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>psqlsetup</RootNamespace>
|
||||
<GenerateImportLib>true</GenerateImportLib>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<!-- GenerateImportLib>true</GenerateImportLib -->
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<!-- GenerateImportLib>true</GenerateImportLib -->
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<!-- GenerateImportLib>true</GenerateImportLib -->
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<!-- GenerateImportLib>true</GenerateImportLib -->
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" >
|
||||
<ANSI_VERSION>no</ANSI_VERSION>
|
||||
<PG_BIN></PG_BIN>
|
||||
<CALL_LIB></CALL_LIB>
|
||||
<DELAY_LOAD_DLLS></DELAY_LOAD_DLLS>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'=='yes'">
|
||||
<TargetName>psqlsetupa</TargetName>
|
||||
<TargetType>ANSI</TargetType>
|
||||
<CALL_LIB>psqlodbc30a.lib</CALL_LIB>
|
||||
<DELAY_LOAD_DLLS>psqlodbc30a.dll;pgenlista.dll</DELAY_LOAD_DLLS>
|
||||
<ADD_DEFINES></ADD_DEFINES>
|
||||
<RSC_DEFINES></RSC_DEFINES>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)'!='yes'">
|
||||
<TargetName>psqlsetup</TargetName>
|
||||
<TargetType>Unicode</TargetType>
|
||||
<CALL_LIB>psqlodbc35w.lib</CALL_LIB>
|
||||
<DELAY_LOAD_DLLS>psqlodbc35w.dll;pgenlist.dll</DELAY_LOAD_DLLS>
|
||||
<ADD_DEFINES>UNICODE_SUPPORT</ADD_DEFINES>
|
||||
<RSC_DEFINES>UNICODE_SUPPORT</RSC_DEFINES>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Import Project="std_dbmsname.Cpp.props" / -->
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)'=='Win32'">
|
||||
<TARGET_CPU>x86</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'!='Win32'">
|
||||
<TARGET_CPU>x64</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(BuildStep)'==''">
|
||||
<GenerateImportLib>false</GenerateImportLib>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IntDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\psqlsetup\</IntDir>
|
||||
<OutDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="psqlodbc.Cpp.props" />
|
||||
|
||||
<PropertyGroup Condition="'$(PG_BIN)'!=''">
|
||||
<ADD_DEFINES>$(ADD_DEFINES);PG_BIN="$(PG_BIN.Replace('\','\\'))"</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;WIN_MULTITHREAD_SUPPORT;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<CustomBuildStep>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuildStep>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;WIN_MULTITHREAD_SUPPORT;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;WIN_MULTITHREAD_SUPPORT;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
|
||||
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</ImpLib>
|
||||
<Link>
|
||||
<DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
|
||||
</Link>
|
||||
<PreLinkEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(GenerateImportLib)'=='true'">
|
||||
<Link>
|
||||
<ModuleDefinitionFile></ModuleDefinitionFile>
|
||||
<AdditionalDependencies>$(TargetName).exp;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(srcPath)psqlsetup.c" />
|
||||
<ClCompile Include="$(srcPath)setup.c" />
|
||||
<ClCompile Include="$(srcPath)dlg_wingui.c" />
|
||||
<ClCompile Include="$(srcPath)dlg_specific.c" />
|
||||
<ClCompile Include="$(srcPath)mylog.c" />
|
||||
<ClCompile Include="$(srcPath)xalibname.c" />
|
||||
<ClCompile Include="$(srcPath)misc.c" />
|
||||
<ClCompile Include="$(srcPath)loadlib.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="$(srcPath)psqlodbc.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
145
winbuild/readme.txt
Normal file
145
winbuild/readme.txt
Normal file
@ -0,0 +1,145 @@
|
||||
Using Powershell and MSBuild is recommended.
|
||||
In fact the binaries of official release are built using this mothod.
|
||||
|
||||
Currently 4 Windows Powershell scripts are provided for developpers.
|
||||
|
||||
winbuild/BuildAll.ps1 - build all dlls for psqlodbc drivers using
|
||||
MSBuild.
|
||||
winbuild/editConfiguration.ps1 - a GUI tool to set Build environment
|
||||
winbuild/regress.ps1 - build regression test programs and run
|
||||
installer/buildInstallers.ps1 - build installers(.msi or setup.exe)
|
||||
|
||||
Use Powershell console or Command Prompt to invoke scripts:
|
||||
|
||||
For example, to build the driver:
|
||||
|
||||
C:\psqlodbc\winbuild\> (Powershell) ./BuildAll.ps1 <options>
|
||||
|
||||
or you can use the same functionality from Command Prompt using Windows
|
||||
helper batch at the parent folder (..\). See ..\readme_winbuild.txt.
|
||||
|
||||
C:\psqlodbc\> (Commnd Prompt) .\BuildAll.bat <options>
|
||||
|
||||
1. Please start a powershell console and set the ExecutionPolicy of
|
||||
Powershell to RemoteSigned or Unrestricted.
|
||||
|
||||
You can get the ExecutionPolicy by typing
|
||||
|
||||
Get-ExecutionPolicy
|
||||
|
||||
When the ExectionPolicy is "Restricted" or "AllSigned" then type e.g.
|
||||
|
||||
Set-ExecutionPolicy RemoteSigned
|
||||
|
||||
To see details about ExecutionPolicy, type
|
||||
|
||||
Get-Help about_Execution_Policies
|
||||
|
||||
2. You have to install one of the following.
|
||||
|
||||
. Visual Studio 2015 non-Express edtion or Express 2015 for Windows
|
||||
Desktop
|
||||
. Visual Studio 2013 non-Express edtion or Express 2013 for Windows
|
||||
Desktop
|
||||
. Visual Studio 2012 non-Express edtion or Express 2012 for Windows
|
||||
Desktop
|
||||
. Full Microsoft Visual C++ 2010
|
||||
. Windows SDK 7.1
|
||||
|
||||
You have to include x64 development tools (bin, lib, include) as
|
||||
well as x86 ones for the installation.
|
||||
|
||||
You can install multiple versions of VC++ and use them.
|
||||
You can easily switch by specifying VCVersion parameter.
|
||||
|
||||
3. Setup Build environment
|
||||
|
||||
Please type
|
||||
|
||||
.\editConfiguration(.ps1)
|
||||
|
||||
and edit the setting of your environment especially the folders
|
||||
you placed libpq related include/lib/bin files.
|
||||
|
||||
4. Build
|
||||
|
||||
Please type
|
||||
|
||||
.\BuildAll(.ps1)
|
||||
|
||||
to invoke build operations.
|
||||
|
||||
If you installed both VC10 and VC12 and you'd like to compile
|
||||
under VC10 environment, type
|
||||
|
||||
.\BuildAll(.ps1) -V(CVersion) 10.0
|
||||
|
||||
or set the value 10.0 to vcversion using ./editConfiguration.
|
||||
|
||||
To see details about the use of BuildAll, type
|
||||
|
||||
Get-Help .\BuildAll(.ps1) [-Detailed | -Examples | -Full]
|
||||
|
||||
5. Outputs of Build
|
||||
|
||||
The build can produce output in up to four directories for each of
|
||||
the debug and release configurations:
|
||||
|
||||
- x64_Unicode_Release the Unicode driver, 64-bit
|
||||
- x86_ANSI_Release the ANSI driver, 64-bit
|
||||
- x86_Unicode_Release the ANSI driver, 32-bit
|
||||
- x86_ANSI_Release the Unicode driver, 32-bit
|
||||
|
||||
For debug builds (-Configuration Debug) the directories are named with
|
||||
Debug instead of Release but otherwise the same.
|
||||
|
||||
pgxalib.dll is only built for the multibyte/unicode version, as it is
|
||||
the same for both unicode and ansi drivers.
|
||||
|
||||
6. How to use drivers.
|
||||
|
||||
You can't use psqlodbc drivers at once you build the drivers.
|
||||
Usually you have to install drivers using installers made by
|
||||
installer/buildInstallers.ps1. buildInstallers.ps1 bundles
|
||||
libpq and related libraries like ssleay32, libeay32 from the
|
||||
PostgreSQL bin directory and MSVC runtime libraries compiled with.
|
||||
|
||||
However, it is painful for developers to build binaries, build
|
||||
installers and install each time the source files are changed.
|
||||
It is recommended to use a special installation-less driver
|
||||
(postgres_devw) registered by regress.ps1
|
||||
|
||||
7. Regression test in place
|
||||
|
||||
After BuildAll(.ps1), please type
|
||||
|
||||
.\regress(.ps1)
|
||||
|
||||
You have to neither install nor copy binaries.
|
||||
By default, build 32-bit binaries from test sources and run the tests.
|
||||
If you'd like to test 64-bit version, please type
|
||||
|
||||
.\regress(.ps1) -p(latform) x64
|
||||
|
||||
Please note the outputs(obj, exe etc) generated by build operations and
|
||||
results of tests are placed in the directory winbuild/test_x86(test_x64
|
||||
in case of 64-bit).
|
||||
|
||||
8. Installer
|
||||
|
||||
To build the .msi installer file:
|
||||
|
||||
C:\psqlodbc\installer\> (Powershell) ./buildInstallers.ps1 <options>
|
||||
or
|
||||
C:\psqlodbc\> (Command Prompt) .\buildInstallers.bat <options>
|
||||
|
||||
By default, buildInstallers.ps1 builds bootstrapper program
|
||||
psqlodbc-setup.exe together.
|
||||
|
||||
See ../installer/readme.txt in the source directory for details.
|
||||
|
||||
Troubleshooting:
|
||||
|
||||
Some documentation on dealing with Windows SDK installation issues
|
||||
can be found on the related pg_build_win page:
|
||||
https://github.com/2ndQuadrant/pg_build_win#troubleshooting
|
393
winbuild/regress.ps1
Normal file
393
winbuild/regress.ps1
Normal file
@ -0,0 +1,393 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Run regressin test on Windows.
|
||||
.DESCRIPTION
|
||||
Build test programs and run them.
|
||||
.PARAMETER Target
|
||||
Specify the target of MSBuild. "Build&Go"(default), "Build" or
|
||||
"Clean" is available.
|
||||
.PARAMETER TestList
|
||||
Specify the list of test cases. If this parameter isn't specified(default),
|
||||
all test cases are executed.
|
||||
.PARAMETER Ansi
|
||||
Specify this switch in case of testing Ansi drivers.
|
||||
.PARAMETER DeclareFetch
|
||||
Specify Use Declare/Fetch mode. "On"(default), "off" or "both" is available.
|
||||
.PARAMETER VCVersion
|
||||
Used Visual Studio version is determined automatically unless this
|
||||
option is specified.
|
||||
.PARAMETER Platform
|
||||
Specify platforms to test. "x64"(default), "Win32" or "both" is available.
|
||||
.PARAMETER Toolset
|
||||
MSBuild PlatformToolset is determined automatically unless this
|
||||
option is specified. Currently "v100", "Windows7.1SDK", "v110",
|
||||
"v110_xp", "v120", "v120_xp", "v140" or "v140_xp" is available.
|
||||
.PARAMETER MSToolsVersion
|
||||
MSBuild ToolsVersion is detemrined automatically unless this
|
||||
option is specified. Currently "4.0", "12.0", "14.0" or "15.0" is
|
||||
available.
|
||||
.PARAMETER Configuration
|
||||
Specify "Release"(default) or "Debug".
|
||||
.PARAMETER BuildConfigPath
|
||||
Specify the configuration xml file name if you want to use
|
||||
the configuration file other than standard one.
|
||||
The relative path is relative to the current directory.
|
||||
.EXAMPLE
|
||||
> .\regress
|
||||
Build with default or automatically selected parameters
|
||||
and run tests.
|
||||
.EXAMPLE
|
||||
> .\regress Clean
|
||||
Clean all generated files.
|
||||
.EXAMPLE
|
||||
> .\regress -TestList connect, deprected
|
||||
Build and run connect-test and deprecated-test.
|
||||
.EXAMPLE
|
||||
> .\regress -Ansi
|
||||
Build and run with ANSI version of drivers.
|
||||
.EXAMPLE
|
||||
> .\regress -V(CVersion) 14.0
|
||||
Build using Visual Studio 14.0 environment and run tests.
|
||||
.EXAMPLE
|
||||
> .\regress -P(latform) x64
|
||||
Build 64bit test programs and run them.
|
||||
.NOTES
|
||||
Author: Hiroshi Inoue
|
||||
Date: August 2, 2016
|
||||
#>
|
||||
|
||||
#
|
||||
# build 32bit & 64bit dlls for VC10 or later
|
||||
#
|
||||
Param(
|
||||
[ValidateSet("Build&Go", "Build", "Clean")]
|
||||
[string]$Target="Build&Go",
|
||||
[string[]]$TestList,
|
||||
[switch]$Ansi,
|
||||
[string]$VCVersion,
|
||||
[ValidateSet("Win32", "x64", "both")]
|
||||
[string]$Platform="x64",
|
||||
[string]$Toolset,
|
||||
[ValidateSet("", "4.0", "12.0", "14.0", "15.0")]
|
||||
[string]$MSToolsVersion,
|
||||
[ValidateSet("Debug", "Release")]
|
||||
[String]$Configuration="Release",
|
||||
[string]$BuildConfigPath,
|
||||
[ValidateSet("off", "on", "both")]
|
||||
[string]$DeclareFetch="on",
|
||||
[string]$SpecificDsn
|
||||
)
|
||||
|
||||
|
||||
function testlist_make($testsf)
|
||||
{
|
||||
$testbins=@()
|
||||
$testnames=@()
|
||||
$dirnames=@()
|
||||
$testexes=@()
|
||||
$f = (Get-Content -Path $testsf) -as [string[]]
|
||||
$nstart=$false
|
||||
foreach ($l in $f) {
|
||||
if ($l[0] -eq "#") {
|
||||
continue
|
||||
}
|
||||
$sary=-split $l
|
||||
if ($sary[0] -eq "#") {
|
||||
continue
|
||||
}
|
||||
if ($sary[0] -eq "TESTBINS") {
|
||||
$nstart=$true
|
||||
$sary[0]=$null
|
||||
if ($sary[1] -eq "=") {
|
||||
$sary[1]=$null
|
||||
}
|
||||
}
|
||||
if ($nstart) {
|
||||
if ($sary[$sary.length - 1] -eq "\") {
|
||||
$sary[$sary.length - 1] = $null
|
||||
} else {
|
||||
$nstart=$false
|
||||
}
|
||||
$testbins+=$sary
|
||||
if (-not $nstart) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
for ($i=0; $i -lt $testbins.length; $i++) {
|
||||
Write-Debug "$i : $testbins[$i]"
|
||||
}
|
||||
|
||||
foreach ($testbin in $testbins) {
|
||||
if ("$testbin" -eq "") {
|
||||
continue
|
||||
}
|
||||
$sary=$testbin.split("/")
|
||||
$testname=$sary[$sary.length -1]
|
||||
$dirname=""
|
||||
for ($i=0;$i -lt $sary.length - 1;$i++) {
|
||||
$dirname+=($sary[$i]+"`\")
|
||||
}
|
||||
Write-Debug "testbin=$testbin => testname=$testname dirname=$dirname"
|
||||
$dirnames += $dirname
|
||||
$testexes+=($dirname+$testname+".exe")
|
||||
$testnames+=$testname.Replace("-test","")
|
||||
}
|
||||
|
||||
return $testexes, $testnames, $dirnames
|
||||
}
|
||||
|
||||
function vcxfile_make($testnames, $dirnames, $vcxfile)
|
||||
{
|
||||
# here-string
|
||||
@'
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!--
|
||||
This file is automatically generated by regress.ps1
|
||||
and used by MSBuild.
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<srcPath>..\test\src\</srcPath>
|
||||
</PropertyGroup>
|
||||
<Target Name="Build">
|
||||
<MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="ClCompile"
|
||||
Properties="TestName=common;Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
'@ > $vcxfile
|
||||
|
||||
for ($i=0; $i -lt $testnames.length; $i++) {
|
||||
$testname=$testnames[$i]
|
||||
$dirname=$dirnames[$i]
|
||||
$testname+="-test"
|
||||
# here-string
|
||||
@"
|
||||
<MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="TestName=$testname;Configuration=`$(Configuration);srcPath=`$(srcPath);SubDir=$dirname"/>
|
||||
"@ >> $vcxfile
|
||||
}
|
||||
# here-string
|
||||
@'
|
||||
<MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="TestName=runsuite;Configuration=$(Configuration);srcPath=$(srcPath)..\"/>
|
||||
<MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="TestName=RegisterRegdsn;Configuration=$(Configuration);srcPath=$(srcPath)..\"/>
|
||||
<!-- MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="TestName=ConfigDsn;Configuration=$(Configuration);srcPath=$(srcPath)..\"/-->
|
||||
<MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="Build"
|
||||
Properties="TestName=reset-db;Configuration=$(Configuration);srcPath=$(srcPath)..\"/>
|
||||
</Target>
|
||||
<Target Name="Clean">
|
||||
<MSBuild Projects="regress_one.vcxproj"
|
||||
Targets="Clean"
|
||||
Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
|
||||
</Target>
|
||||
</Project>
|
||||
'@ >> $vcxfile
|
||||
|
||||
}
|
||||
|
||||
function RunTest($scriptPath, $Platform, $testexes)
|
||||
{
|
||||
# Run regression tests
|
||||
if ($Platform -eq "x64") {
|
||||
$targetdir="test_x64"
|
||||
} else {
|
||||
$targetdir="test_x86"
|
||||
}
|
||||
$revsdir="..\"
|
||||
$origdir="${revsdir}..\test"
|
||||
|
||||
pushd $scriptPath\$targetdir
|
||||
|
||||
try {
|
||||
$regdiff="regression.diffs"
|
||||
$RESDIR="results"
|
||||
if (Test-Path $regdiff) {
|
||||
Remove-Item $regdiff
|
||||
}
|
||||
New-Item $RESDIR -ItemType Directory -Force > $null
|
||||
Get-Content "${origdir}\sampletables.sql" | .\reset-db
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "`treset_db error"
|
||||
}
|
||||
$cnstr = @()
|
||||
switch ($DeclareFetch) {
|
||||
"off" { $cnstr += "UseDeclareFetch=0" }
|
||||
"on" { $cnstr += "UseDeclareFetch=1" }
|
||||
"both" { $cnstr += "UseDeclareFetch=0"
|
||||
$cnstr += "UseDeclareFetch=1" }
|
||||
}
|
||||
if ($cnstr.length -eq 0) {
|
||||
$cnstr += $null;
|
||||
}
|
||||
for ($i = 0; $i -lt $cnstr.length; $i++)
|
||||
{
|
||||
$env:COMMON_CONNECTION_STRING_FOR_REGRESSION_TEST = $cnstr[$i]
|
||||
if ("$SpecificDsn" -ne "") {
|
||||
$env:COMMON_CONNECTION_STRING_FOR_REGRESSION_TEST += ";Database=contrib_regression;ConnSettings={set lc_messages='C'}"
|
||||
}
|
||||
write-host "`n`tSetting by env variable:$env:COMMON_CONNECTION_STRING_FOR_REGRESSION_TEST"
|
||||
.\runsuite $testexes --inputdir=$origdir
|
||||
}
|
||||
} catch [Exception] {
|
||||
throw $error[0]
|
||||
} finally {
|
||||
popd
|
||||
$env:COMMON_CONNECTION_STRING_FOR_REGRESSION_TEST = $null
|
||||
}
|
||||
}
|
||||
|
||||
function SpecialDsn($testdsn, $testdriver)
|
||||
{
|
||||
function input-dsninfo($server="localhost", $uid="postgres", $passwd="postgres", $port="5432", $database="contrib_regression")
|
||||
{
|
||||
$in = read-host "Server [$server]"
|
||||
if ("$in" -ne "") {
|
||||
$server = $in
|
||||
}
|
||||
$in = read-host "Port [$port]"
|
||||
if ("$in" -ne "") {
|
||||
$port = $in
|
||||
}
|
||||
$in = read-host "Username [$uid]"
|
||||
if ("$in" -ne "") {
|
||||
$uid = $in
|
||||
}
|
||||
$in = read-host -assecurestring "Password [$passwd]"
|
||||
if ("$in" -ne "") {
|
||||
$ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($in)
|
||||
$passwd = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
|
||||
}
|
||||
return "SERVER=${server}|DATABASE=${database}|PORT=${port}|UID=${uid}|PWD=${passwd}"
|
||||
}
|
||||
|
||||
$regProgram = "./RegisterRegdsn.exe"
|
||||
& $regProgram "existCheck" $testdsn
|
||||
if ($LastExitCode -eq -1) {
|
||||
Write-Host "`tAdding System DSN=$testdsn Driver=$testdriver"
|
||||
$prop = input-dsninfo
|
||||
$prop += "|Debug=0|Commlog=0|ConnSettings=set+lc_messages='C'"
|
||||
$proc = Start-Process $regProgram -Verb runas -Wait -PassThru -ArgumentList "register_dsn $testdriver $testdsn $prop `"$dlldir`" Driver=${dllname}|Setup=${setup}"
|
||||
if ($proc.ExitCode -ne 0) {
|
||||
throw "`tAddDsn $testdsn error"
|
||||
}
|
||||
}
|
||||
elseif ($LastExitCode -ne 0) {
|
||||
throw "$regProgram error"
|
||||
}
|
||||
}
|
||||
|
||||
$scriptPath = (Split-Path $MyInvocation.MyCommand.Path)
|
||||
$usingExe=$true
|
||||
$testsf="$scriptPath\..\test\tests"
|
||||
Write-Debug testsf=$testsf
|
||||
$vcxfile="$scriptPath\generated_regress.vcxproj"
|
||||
|
||||
$arrays=testlist_make $testsf
|
||||
if ($null -eq $TestList) {
|
||||
$TESTEXES=$arrays[0]
|
||||
$TESTNAMES=$arrays[1]
|
||||
$DIRNAMES=$arrays[2]
|
||||
} else {
|
||||
$err=$false
|
||||
$TESTNAMES=$TestList
|
||||
$TESTEXES=@()
|
||||
$DIRNAMES=@()
|
||||
foreach ($l in $TestList) {
|
||||
for ($i=0;$i -lt $arrays[1].length;$i++) {
|
||||
if ($l -eq $arrays[1][$i]) {
|
||||
$TESTEXES+=$arrays[0][$i]
|
||||
$DIRNAMES+=$arrays[2][$i]
|
||||
break
|
||||
}
|
||||
}
|
||||
<# if ($i -ge $arrays[1].length) {
|
||||
Write-Host "!! test case $l doesn't exist"
|
||||
$err=$true
|
||||
} #>
|
||||
}
|
||||
if ($err) {
|
||||
return
|
||||
}
|
||||
}
|
||||
vcxfile_make $TESTNAMES $DIRNAMES $vcxfile
|
||||
|
||||
Import-Module "$scriptPath\Psqlodbc-config.psm1"
|
||||
$configInfo = LoadConfiguration $BuildConfigPath $scriptPath
|
||||
Import-Module ${scriptPath}\MSProgram-Get.psm1
|
||||
$msbuildexe=Find-MSBuild ([ref]$VCVersion) ([ref]$MSToolsVersion) ([ref]$Toolset) $configInfo
|
||||
write-host "vcversion=$VCVersion toolset=$Toolset"
|
||||
Remove-Module MSProgram-Get
|
||||
Remove-Module Psqlodbc-config
|
||||
|
||||
if ($Platform -ieq "both") {
|
||||
$pary = @("Win32", "x64")
|
||||
} else {
|
||||
$pary = @($Platform)
|
||||
}
|
||||
|
||||
$vcx_target=$target
|
||||
if ($target -ieq "Build&Go") {
|
||||
$vcx_target="Build"
|
||||
}
|
||||
if ($Ansi) {
|
||||
write-host ** testing Ansi driver **
|
||||
$testdriver="postgres_deva"
|
||||
$testdsn="psqlodbc_test_dsn_ansi"
|
||||
$ansi_dir_part="ANSI"
|
||||
$dllname="psqlsetupa.dll"
|
||||
$setup="psqlsetupa.dll"
|
||||
} else {
|
||||
write-host ** testing unicode driver **
|
||||
$testdriver="postgres_devw"
|
||||
$testdsn="psqlodbc_test_dsn"
|
||||
$ansi_dir_part="Unicode"
|
||||
$dllname="psqlsetup.dll"
|
||||
$setup="psqlsetup.dll"
|
||||
}
|
||||
if ("$SpecificDsn" -ne "") {
|
||||
Write-Host "`tSpecific DSN=$SpecificDsn"
|
||||
$testdsn=$SpecificDsn
|
||||
}
|
||||
foreach ($pl in $pary) {
|
||||
cd $scriptPath
|
||||
& ${msbuildexe} ${vcxfile} /tv:$MSToolsVersion "/p:Platform=$pl;Configuration=$Configuration;PlatformToolset=${Toolset}" /t:$vcx_target /p:VisualStudioVersion=${VCVersion} /Verbosity:minimal
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "`nCompile error"
|
||||
}
|
||||
|
||||
if (($target -ieq "Clean") -or ($target -ieq "Build")) {
|
||||
continue
|
||||
}
|
||||
|
||||
switch ($pl) {
|
||||
"Win32" {
|
||||
$targetdir="test_x86"
|
||||
$bit="32-bit"
|
||||
$dlldir="$scriptPath\..\x86_${ansi_dir_part}_Release"
|
||||
}
|
||||
default {
|
||||
$targetdir="test_x64"
|
||||
$bit="64-bit"
|
||||
$dlldir="$scriptPath\..\x64_${ansi_dir_part}_Release"
|
||||
}
|
||||
}
|
||||
pushd $scriptPath\$targetdir
|
||||
|
||||
$env:PSQLODBC_TEST_DSN = $testdsn
|
||||
try {
|
||||
SpecialDsn $testdsn $testdriver
|
||||
RunTest $scriptPath $pl $TESTEXES
|
||||
} catch [Exception] {
|
||||
throw $error[0]
|
||||
} finally {
|
||||
popd
|
||||
$env:PSQLODBC_TEST_DSN = $null
|
||||
}
|
||||
}
|
173
winbuild/regress_one.vcxproj
Normal file
173
winbuild/regress_one.vcxproj
Normal file
@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{BBD60387-0E82-48F9-A0B3-41659252D639}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>regress</RootNamespace>
|
||||
<ProjectName>regress</ProjectName>
|
||||
<TestName>regressw</TestName>
|
||||
<SubDir></SubDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Ansi</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Ansi</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Ansi</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Ansi</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'=='Win32'">
|
||||
<TARGET_CPU>x86</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'!='Win32'">
|
||||
<TARGET_CPU>x64</TARGET_CPU>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<TargetName>$(TestName)</TargetName>
|
||||
<IntDir>test_$(TARGET_CPU)\obj\</IntDir>
|
||||
<OutDir>test_$(TARGET_CPU)\$(SubDir)</OutDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="pguser.Cpp.props" />
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>$(IntDir)common.obj;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>$(IntDir)common.obj;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>$(IntDir)common.obj;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>$(IntDir)common.obj;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(srcPath)$(TestName).c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
winbuild/std_dbmsname.Cpp.props
Normal file
22
winbuild/std_dbmsname.Cpp.props
Normal file
@ -0,0 +1,22 @@
|
||||
<!--
|
||||
***********************************************************************************************
|
||||
dbmsname.Cpp.props
|
||||
|
||||
***********************************************************************************************
|
||||
-->
|
||||
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- -->
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)|$(Platform)'=='yes|Win32'" >
|
||||
<ADD_DEFINES>$(ADD_DEFINES);DBMS_NAME="PostgreSQL ANSI"</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)|$(Platform)'=='yes|x64'" >
|
||||
<ADD_DEFINES>$(ADD_DEFINES);DBMS_NAME="PostgreSQL ANSI(x64)"</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)|$(Platform)'=='no|Win32'" >
|
||||
<ADD_DEFINES>$(ADD_DEFINES);DBMS_NAME="PostgreSQL Unicode"</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(ANSI_VERSION)|$(Platform)'=='no|x64'" >
|
||||
<ADD_DEFINES>$(ADD_DEFINES);DBMS_NAME="PostgreSQL Unicode(x64)"</ADD_DEFINES>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user