From 55aef9fa42625404d1a69db763832627c2f59094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Sun, 23 Jun 2019 15:58:09 +0200 Subject: [PATCH] vs2019 support --- build_vs160.cmd | 2 ++ buildwin.cmd | 28 ++++++++++++++++++++++------ buildwin.ps1 | 16 +++++++++++----- 3 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 build_vs160.cmd diff --git a/build_vs160.cmd b/build_vs160.cmd new file mode 100644 index 000000000..6a9bb89eb --- /dev/null +++ b/build_vs160.cmd @@ -0,0 +1,2 @@ +@echo off +buildwin 160 build shared both Win32 samples tests devenv diff --git a/buildwin.cmd b/buildwin.cmd index 5710ae229..4b0f1bd5a 100644 --- a/buildwin.cmd +++ b/buildwin.cmd @@ -5,9 +5,9 @@ rem rem buildwin.cmd rem rem POCO C++ Libraries command-line build script -rem for MS Visual Studio 2008 to 2013 +rem for MS Visual Studio 2008 to 2019 rem -rem Copyright (c) 2006-2017 by Applied Informatics Software Engineering GmbH +rem Copyright (c) 2006-2019 by Applied Informatics Software Engineering GmbH rem and Contributors. rem rem Original version by Aleksandar Fabijanic. @@ -16,7 +16,7 @@ rem rem Usage: rem ------ rem buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL] -rem VS_VERSION: 90|100|110|120|140|150 +rem VS_VERSION: 90|100|110|120|140|150|160 rem ACTION: build|rebuild|clean rem LINKMODE: static_mt|static_md|shared|all rem CONFIGURATION: release|debug|both @@ -44,13 +44,17 @@ set LIB=%LIB%;%MYSQL_LIB% set POCO_BASE=%CD% set PATH=%POCO_BASE%\bin64;%POCO_BASE%\bin;%PATH% -rem VS_VERSION {90 | 100 | 110 | 120 | 140 | 150} +rem VS_VERSION {90 | 100 | 110 | 120 | 140 | 150 | 160} if "%1"=="" goto usage set VS_VERSION=vs%1 -if %VS_VERSION%==vs150 ( +if %VS_VERSION%==vs160 ( set VS_VARSALL=..\..\VC\Auxiliary\Build\vcvarsall.bat ) else ( - set VS_VARSALL=..\..\VC\vcvarsall.bat + if %VS_VERSION%==vs150 ( + set VS_VARSALL=..\..\VC\Auxiliary\Build\vcvarsall.bat + ) else ( + set VS_VARSALL=..\..\VC\vcvarsall.bat + ) ) rem PLATFORM [Win32|x64|WinCE|WEC2013] set PLATFORM=%5 @@ -102,6 +106,14 @@ if not defined VCINSTALLDIR ( ) else ( call "%VS150COMNTOOLS%%VS_VARSALL%" x86 8.1 ) + ) else ( + if %VS_VERSION%==vs160 ( + if %PLATFORM%==x64 ( + call "%VS160COMNTOOLS%%VS_VARSALL%" x86_amd64 8.1 + ) else ( + call "%VS160COMNTOOLS%%VS_VARSALL%" x86 8.1 + ) + ) ) ) ) @@ -123,6 +135,7 @@ if %VS_VERSION%==vs110 (set VCPROJ_EXT=vcxproj) if %VS_VERSION%==vs120 (set VCPROJ_EXT=vcxproj) if %VS_VERSION%==vs140 (set VCPROJ_EXT=vcxproj) if %VS_VERSION%==vs150 (set VCPROJ_EXT=vcxproj) +if %VS_VERSION%==vs160 (set VCPROJ_EXT=vcxproj) if "%8"=="" goto use_devenv set BUILD_TOOL=%8 @@ -134,6 +147,7 @@ if "%VS_VERSION%"=="vs110" (set BUILD_TOOL=msbuild) if "%VS_VERSION%"=="vs120" (set BUILD_TOOL=msbuild) if "%VS_VERSION%"=="vs140" (set BUILD_TOOL=msbuild) if "%VS_VERSION%"=="vs150" (set BUILD_TOOL=msbuild) +if "%VS_VERSION%"=="vs160" (set BUILD_TOOL=msbuild) :use_custom if not "%BUILD_TOOL%"=="msbuild" (set USEENV=/useenv) if "%BUILD_TOOL%"=="msbuild" ( @@ -150,6 +164,7 @@ if "%VS_VERSION%"=="vs110" (goto msbuildok) if "%VS_VERSION%"=="vs120" (goto msbuildok) if "%VS_VERSION%"=="vs140" (goto msbuildok) if "%VS_VERSION%"=="vs150" (goto msbuildok) +if "%VS_VERSION%"=="vs160" (goto msbuildok) if "%BUILD_TOOL%"=="msbuild" ( echo "Cannot use msbuild with Visual Studio 2008 or earlier." exit /b 2 @@ -194,6 +209,7 @@ if %VS_VERSION%==vs110 (set EXTRASW=/m /p:VisualStudioVersion=11.0) if %VS_VERSION%==vs120 (set EXTRASW=/m /p:VisualStudioVersion=12.0) if %VS_VERSION%==vs140 (set EXTRASW=/m /p:VisualStudioVersion=14.0) if %VS_VERSION%==vs150 (set EXTRASW=/m /p:VisualStudioVersion=15.0) +if %VS_VERSION%==vs160 (set EXTRASW=/m /p:VisualStudioVersion=16.0) ) rem SAMPLES [samples|nosamples] diff --git a/buildwin.ps1 b/buildwin.ps1 index a08aea3ff..dcc6ee732 100644 --- a/buildwin.ps1 +++ b/buildwin.ps1 @@ -4,7 +4,7 @@ # Usage: # ------ # buildwin.ps1 [-poco_base dir] -# [-vs_version 150 | 140 | 120 | 110 | 100 | 90] +# [-vs_version 160 | 150 | 140 | 120 | 110 | 100 | 90] # [-action build | rebuild | clean] # [-linkmode shared | static_mt | static_md | all] # [-config release | debug | both] @@ -23,7 +23,7 @@ Param [string] $poco_base, [Parameter()] - [ValidateSet(90, 100, 110, 120, 140, 150)] + [ValidateSet(90, 100, 110, 120, 140, 150, 160)] [int] $vs_version, [Parameter()] @@ -78,7 +78,8 @@ function Set-Environment if ($vs_version -eq 0) { - if ($Env:VS150COMNTOOLS -ne '') { $script:vs_version = 150 } + if ($Env:VS160COMNTOOLS -ne '') { $script:vs_version = 160 } + elseif ($Env:VS150COMNTOOLS -ne '') { $script:vs_version = 150 } elseif ($Env:VS140COMNTOOLS -ne '') { $script:vs_version = 140 } elseif ($Env:VS120COMNTOOLS -ne '') { $script:vs_version = 120 } elseif ($Env:VS110COMNTOOLS -ne '') { $script:vs_version = 110 } @@ -120,7 +121,12 @@ function Set-Environment $CommandArg = '' if ($platform -eq 'x64') { $CommandArg = "amd64" } else { $CommandArg = "x86" } - if ($vs_version -ge 150) + if ($vs_version -ge 160) + { + $Command = "$($vsdir)\..\..\VC\Auxiliary\Build\vcvarsall.bat" + $script:msbuild_exe = "$($vsdir)\..\..\MSBuild\Current\Bin\MSBuild.exe" + } + elseif ($vs_version -ge 150) { $Command = "$($vsdir)\..\..\VC\Auxiliary\Build\vcvarsall.bat" $script:msbuild_exe = "$($vsdir)\..\..\MSBuild\15.0\Bin\MSBuild.exe" @@ -149,7 +155,7 @@ function Process-Input Write-Host 'Usage:' Write-Host '------' Write-Host 'buildwin.ps1 [-poco_base dir]' - Write-Host ' [-vs_version 150 | 140 | 120 | 110 | 100 | 90]' + Write-Host ' [-vs_version 160 | 150 | 140 | 120 | 110 | 100 | 90]' Write-Host ' [-action build | rebuild | clean]' Write-Host ' [-linkmode shared | static_mt | static_md | all]' Write-Host ' [-config release | debug | both]'