CI: Use Visual Studio 2019 for the MSVC CI

...and add ability to select target platform for calling vcvarsall.bat,
so that we can accomodate 32-bit builds and possibly ARM64 builds in the
CI if we need to.
This commit is contained in:
Chun-wei Fan 2024-09-30 18:08:15 +08:00
parent c94cbf2368
commit 0f0d5df4e5
2 changed files with 14 additions and 6 deletions

View File

@ -586,7 +586,7 @@ msys2-clang64:
paths:
- _build/meson-logs
vs2017-x64:
vs2019-x64:
extends: .only-default
stage: build
tags:
@ -605,6 +605,7 @@ vs2017-x64:
--wrap-mode=default
--python.platlibdir=C:\Python37\site-packages
--python.purelibdir=C:\Python37\site-packages
--plat=x64
artifacts:
reports:
junit:
@ -621,7 +622,7 @@ vs2017-x64:
- _build/gthread/libgthread-2.0-0.dll
- _build/gobject/libgobject-2.0-0.dll
vs2017-x64-static:
vs2019-x64-static:
extends: .only-default
stage: build
tags:
@ -641,6 +642,7 @@ vs2017-x64-static:
--default-library=static
--python.platlibdir=C:\Python37\site-packages
--python.purelibdir=C:\Python37\site-packages
--plat=x64
artifacts:
reports:
junit:

View File

@ -1,15 +1,21 @@
@echo on
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
:: specified build architecture
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
:: Remove quotes from script args
setlocal enabledelayedexpansion
set args=
set stash_plat=0
for %%x in (%*) do (
set args=!args! %%~x
if "%%x" == "--plat" set stash_plat=1
if "!stash_plat!" == "0" set args=!args! %%~x
if "!stash_plat!" == "1" if /i not "%%x" == "--plat" set plat=%%x & set stash_plat=0
)
set args=%args:~1%
if "!plat!" == "" set plat=x64
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
:: specified build architecture
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" !plat!
pip3 install --upgrade --user meson==1.4.2 || goto :error
meson setup %args% _build || goto :error