1
0
mirror of https://github.com/pocoproject/poco.git synced 2025-04-27 10:25:59 +02:00

Merge branch 'poco-1.9.1' of https://github.com/pocoproject/poco.git into poco-1.9.1

This commit is contained in:
Francis ANDRE 2018-06-01 00:07:02 +02:00
commit e48eb75272

@ -228,11 +228,17 @@ function Exec-MSBuild([string] $vsProject, [string] $projectConfig)
} }
function Build-MSBuild([string] $vsProject) function Build-MSBuild([string] $vsProject, [switch] $skipStatic)
{ {
if ($linkmode -contains "static" -and $skipStatic) { Return }
if ($linkmode -eq 'all') if ($linkmode -eq 'all')
{ {
$linkModeArr = 'shared', 'static_mt', 'static_md' $linkModeArr = @('shared')
if (-not $skipStatic)
{
$linkModeArr += 'static_mt', 'static_md'
}
foreach ($mode in $linkModeArr) foreach ($mode in $linkModeArr)
{ {
@ -276,11 +282,17 @@ function Exec-Devenv([string] $projectConfig, [string] $vsProject)
} }
function Build-Devenv([string] $vsProject) function Build-Devenv([string] $vsProject, [switch] $skipStatic)
{ {
if ($linkmode -contains "static" -and $skipStatic) { Return }
if ($linkmode -eq 'all') if ($linkmode -eq 'all')
{ {
$linkModeArr = 'shared', 'static_mt', 'static_md' $linkModeArr = @('shared')
if (-not $skipStatic)
{
$linkModeArr += 'static_mt', 'static_md'
}
foreach ($mode in $linkModeArr) foreach ($mode in $linkModeArr)
{ {
@ -328,6 +340,25 @@ function Build-samples
} }
function Build-Exec([string] $tool, [string] $vsProject, [switch] $skipStatic)
{
if (!(Test-Path -Path $vsProject)) # not found
{
Write-Host "+------------------------------------------------------------------"
Write-Host "| VS project $vsProject not found, skipping."
Write-Host "+------------------------------------------------------------------"
Return
}
if ($tool -eq 'devenv') { Build-Devenv $vsProject -skipStatic:$skipStatic }
elseif ($tool -eq 'msbuild') { Build-MSBuild $vsProject -skipStatic:$skipStatic }
else
{
Write-Host "Build tool $tool not supported. Exiting."
Exit -1
}
}
function Build-Components([string] $extension, [string] $platformName, [string] $type) function Build-Components([string] $extension, [string] $platformName, [string] $type)
{ {
@ -341,7 +372,7 @@ function Build-Components([string] $extension, [string] $platformName, [string]
$omitArray = @() $omitArray = @()
$omit.Split(',;') | ForEach { $omit.Split(',;') | ForEach {
$omitArray += "$_" $omitArray += $_.Trim()
} }
if ($omitArray -NotContains $component) if ($omitArray -NotContains $component)
@ -366,14 +397,7 @@ function Build-Components([string] $extension, [string] $platformName, [string]
if ($type -eq "lib") if ($type -eq "lib")
{ {
if ($tool -eq 'devenv') { Build-Devenv $vsProject } Build-Exec $tool $vsProject
elseif ($tool -eq 'msbuild') { Build-MSBuild $vsProject }
elseif ($tool -ne '') { Write-Host "Build tool not supported: $tool" }
else
{
Write-Host "Build tool not specified. Exiting."
Exit -1
}
} }
ElseIf ($tests -and ($type -eq "test")) ElseIf ($tests -and ($type -eq "test"))
{ {
@ -381,16 +405,37 @@ function Build-Components([string] $extension, [string] $platformName, [string]
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "| Building $vsTestProject" Write-Host "| Building $vsTestProject"
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Build-Exec $tool $vsTestProject
if ($tool -eq 'devenv') { Build-Devenv $vsTestProject } if ($component -eq "Foundation") # special case for Foundation, which needs test app and dll
elseif ($tool -eq 'msbuild') { Build-MSBuild $vsTestProject } {
else{ Write-Host "Tool not supported: $tool" } $vsTestProject = "$poco_base\$componentDir\testsuite\TestApp$($platformName)$($suffix).$($extension)"
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "| Building $vsTestProject"
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Build-Exec $tool $vsTestProject
$vsTestProject = "$poco_base\$componentDir\testsuite\TestLibrary$($platformName)$($suffix).$($extension)"
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "| Building $vsTestProject"
Write-Host "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Build-Exec $tool $vsTestProject -skipStatic
}
} }
ElseIf ($samples -and ($type -eq "sample")) ElseIf ($samples -and ($type -eq "sample"))
{ {
Get-Childitem "$poco_base\$($componentDir)" -Recurse |` if ($platform -eq 'x64')
Where {$_.Extension -Match $extension -And $_.DirectoryName -Like "*samples*" -And $_.BaseName -Like "*$platformName$($suffix)" } ` {
| Build-samples "$_" Get-Childitem "$poco_base\$($componentDir)" -Recurse |`
Where {$_.Extension -Match $extension -And $_.DirectoryName -Like "*samples*" -And $_.BaseName -Like "*$platformName$($suffix)" } `
| Build-samples "$_"
}
else
{
Get-Childitem "$poco_base\$($componentDir)" -Recurse |`
Where {$_.Extension -Match $extension -And $_.DirectoryName -Like "*samples*" -And $_.BaseName -Like "*$($suffix)" -And $_.BaseName -NotLike "*_x64_*" } `
| Build-samples "$_"
}
} }
} }
else else