zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 0744d93ed550dfb85af1d8cbe3b18e5e5d02b290 (tree)
parent 8e9e126d41cbca619a2a4658fb38d10120388e8f
Author: emekoi <emekankurumeh@outlook.com>
Date:   Sat, 11 Apr 2020 19:58:48 -0500

added CI job for mingw

Diffstat:
Mci/azure/pipelines.yml | 12++++++++++--
Aci/azure/windows_mingw_script | 21+++++++++++++++++++++
Rci/azure/windows_install -> ci/azure/windows_msvc_install | 0
Aci/azure/windows_msvc_script.bat | 31+++++++++++++++++++++++++++++++
Dci/azure/windows_script.bat | 31-------------------------------
5 files changed, 62 insertions(+), 33 deletions(-)

diff --git a/ci/azure/pipelines.yml b/ci/azure/pipelines.yml @@ -28,12 +28,20 @@ jobs: - job: BuildWindows pool: vmImage: 'windows-2019' + strategy: + matrix: + mingw64: + CHERE_INVOKING: yes + MSYSTEM: MINGW64 + SCRIPT: '%CD:~0,2%\msys64\usr\bin\bash -lc "bash ci/azure/windows_mingw_script"' + msvc: + SCRIPT: ci/azure/windows_msvc_script.bat timeoutInMinutes: 360 steps: - script: | - git clone https://github.com/lazka/msys2-ci-base.git %CD:~0,2%\msys64 + git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64 %CD:~0,2%\msys64\usr\bin\rm -rf %CD:~0,2%\msys64\.git set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Syyuu @@ -41,7 +49,7 @@ jobs: - task: DownloadSecureFile@1 inputs: secureFile: s3cfg - - script: ci/azure/windows_script.bat + - script: $(SCRIPT) name: main displayName: 'Build and test' - job: OnMasterSuccess diff --git a/ci/azure/windows_mingw_script b/ci/azure/windows_mingw_script @@ -0,0 +1,21 @@ +#!/bin/sh + +set -x +set -e + +pacman --noconfirm --needed -S git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-llvm + +git config core.abbrev 9 + +ZIGBUILDDIR="$(pwd)/build" +PREFIX="$ZIGBUILDDIR/dist" +CMAKEFLAGS="-DCMAKE_COLOR_MAKEFILE=OFF -DCMAKE_INSTALL_PREFIX=$PREFIX -DZIG_STATIC=ON" + +mkdir $ZIGBUILDDIR +cd $ZIGBUILDDIR + +cmake .. -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo $CMAKEFLAGS -DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=lld -Wl,/debug,/pdb:zig.pdb' + +make -j$(nproc) install + +./zig build test-behavior -Dskip-non-native -Dskip-release diff --git a/ci/azure/windows_install b/ci/azure/windows_msvc_install diff --git a/ci/azure/windows_msvc_script.bat b/ci/azure/windows_msvc_script.bat @@ -0,0 +1,31 @@ +@echo on +SET "SRCROOT=%cd%" +SET "PREVPATH=%PATH%" +SET "PREVMSYSEM=%MSYSTEM%" + +set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" +SET "MSYSTEM=MINGW64" +bash -lc "cd ${SRCROOT} && ci/azure/windows_msvc_install" || exit /b +SET "PATH=%PREVPATH%" +SET "MSYSTEM=%PREVMSYSTEM%" + +SET "ZIGBUILDDIR=%SRCROOT%\build" +SET "ZIGINSTALLDIR=%ZIGBUILDDIR%\dist" +SET "ZIGPREFIXPATH=%SRCROOT%\llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt" + +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + +REM Make the `zig version` number consistent. +REM This will affect the cmake command below. +git.exe config core.abbrev 9 + +mkdir %ZIGBUILDDIR% +cd %ZIGBUILDDIR% +cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b +msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b + +"%ZIGINSTALLDIR%\bin\zig.exe" build test || exit /b + +set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" +SET "MSYSTEM=MINGW64" +bash -lc "cd ${SRCROOT} && ci/azure/windows_upload" || exit /b diff --git a/ci/azure/windows_script.bat b/ci/azure/windows_script.bat @@ -1,31 +0,0 @@ -@echo on -SET "SRCROOT=%cd%" -SET "PREVPATH=%PATH%" -SET "PREVMSYSEM=%MSYSTEM%" - -set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" -SET "MSYSTEM=MINGW64" -bash -lc "cd ${SRCROOT} && ci/azure/windows_install" || exit /b -SET "PATH=%PREVPATH%" -SET "MSYSTEM=%PREVMSYSTEM%" - -SET "ZIGBUILDDIR=%SRCROOT%\build" -SET "ZIGINSTALLDIR=%ZIGBUILDDIR%\dist" -SET "ZIGPREFIXPATH=%SRCROOT%\llvm+clang+lld-10.0.0-x86_64-windows-msvc-release-mt" - -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - -REM Make the `zig version` number consistent. -REM This will affect the cmake command below. -git.exe config core.abbrev 9 - -mkdir %ZIGBUILDDIR% -cd %ZIGBUILDDIR% -cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release || exit /b -msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b - -"%ZIGINSTALLDIR%\bin\zig.exe" build test || exit /b - -set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" -SET "MSYSTEM=MINGW64" -bash -lc "cd ${SRCROOT} && ci/azure/windows_upload" || exit /b