From 532fec021404a5f5ceda068d176fd2ab1cd1955c Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Tue, 3 Sep 2024 14:48:50 +0300 Subject: [PATCH] ci: Fix the verification of the msys2 toolchain on AppVeyor CI Initialize the arch-specific MSYSTEM environment variable, to ensure that msys2 bash picks up and executes /etc/profile correctly. Install and use the host-specific cmake and ninja, to ensure that msys2 cmake picks up the host-specific zlib build correctly. --- .appveyor.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ddeb4ecf5..ee3d27ad3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -48,6 +48,7 @@ install: - 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install' - 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows' - 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install' + - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-ninja' before_build: - 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022' @@ -58,11 +59,11 @@ before_build: - 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0' - 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja' - 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake' - - 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang.exe' - - 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" set CI_CMAKE_GENERATOR=Unix Makefiles' - - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set PATH=C:\msys64\mingw32\bin;%PATH%' - - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set PATH=C:\msys64\mingw64\bin;%PATH%' - - 'if "%TOOLCHAIN%"=="msys2" set CI_CC=%ARCH%-w64-mingw32-gcc.exe' + - 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang' + - 'if "%TOOLCHAIN%"=="msys2" set CI_CMAKE_GENERATOR=Ninja' + - 'if "%TOOLCHAIN%"=="msys2" set CI_CC=gcc' + - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set MSYSTEM=MINGW32' + - 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set MSYSTEM=MINGW64' - 'set CI_CMAKE_BUILD_FLAGS=-j2' - 'set CI_CTEST_FLAGS=-j2' - 'set CI_MAKE_FLAGS=-j2' @@ -77,3 +78,4 @@ build_script: cache: - C:\tools\vcpkg\installed + - C:\msys64\var\cache\pacman