Completely update the AppVeyor proejct. It now only handles MinGW and VS2013 builds, and uses YAML better. Partially based on guidance in the meson documentation.
This commit is contained in:
parent
69bfbbf19c
commit
3037d7b87f
121
.appveyor.yml
121
.appveyor.yml
|
@ -2,66 +2,99 @@ version: 'build #{build}'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- linking: shared
|
- arch: 386
|
||||||
|
libtype: shared
|
||||||
|
libfiles: libui.dll libui.lib
|
||||||
compiler: msvc2013
|
compiler: msvc2013
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||||
- linking: static
|
- arch: 386
|
||||||
|
libtype: static
|
||||||
|
libfiles: libui.lib
|
||||||
compiler: msvc2013
|
compiler: msvc2013
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||||
- linking: shared
|
- arch: amd64
|
||||||
compiler: msvc2015
|
libtype: shared
|
||||||
|
libfiles: libui.dll libui.lib
|
||||||
|
compiler: msvc2013
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||||
|
- arch: amd64
|
||||||
|
libtype: static
|
||||||
|
libfiles: libui.lib
|
||||||
|
compiler: msvc2013
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||||
|
- arch: 386
|
||||||
|
libtype: static
|
||||||
|
libfiles: libui.lib
|
||||||
|
compiler: mingw
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- linking: static
|
- arch: amd64
|
||||||
compiler: msvc2015
|
libtype: static
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
libfiles: libui.lib
|
||||||
- linking: shared
|
|
||||||
compiler: msvc2017
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
||||||
- linking: static
|
|
||||||
compiler: msvc2017
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
||||||
- linking: static
|
|
||||||
compiler: mingw
|
compiler: mingw
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
- Win32
|
|
||||||
- x64
|
- x64
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- if %compiler%==msvc2013 ( set "CMAKE_GENERATOR=Visual Studio 12 2013" )
|
- cmd: |
|
||||||
else if %compiler%==msvc2015 ( set "CMAKE_GENERATOR=Visual Studio 14 2015" )
|
rem Set Python Version
|
||||||
else if %compiler%==msvc2017 ( set "CMAKE_GENERATOR=Visual Studio 15 2017" )
|
if %arch%==386 (
|
||||||
else if %compiler%==mingw ( set "CMAKE_GENERATOR=MinGW Makefiles" )
|
set PYTHON_ROOT=C:\python37
|
||||||
- if %compiler%-%platform%==mingw-Win32 ( set "PATH=C:\msys64\mingw32\bin;%PATH%" )
|
) else (
|
||||||
else if %compiler%-%platform%==mingw-x64 ( set "PATH=C:\msys64\mingw64\bin;%PATH%" )
|
set PYTHON_ROOT=C:\python37-x64
|
||||||
else if %platform%==x64 ( set "CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64" )
|
)
|
||||||
- if %linking%==static ( set CMAKE_FLAGS=-DBUILD_SHARED_LIBS=OFF )
|
set "PATH=%PYTHON_ROOT%;%PYTHON_ROOT%\Scripts;%PATH%"
|
||||||
- if %compiler%==mingw ( set "outdir=build\out" ) else ( set "outdir=build\out\Release" )
|
|
||||||
- ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
|
rem Install Latest Meson
|
||||||
- set "simultaneous=3"
|
pip install meson
|
||||||
|
|
||||||
|
rem Install Ninja
|
||||||
|
powershell -Command "Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip -OutFile C:\ninja-win.zip"
|
||||||
|
mkdir C:\ninja
|
||||||
|
powershell -Command "Expand-Archive -LiteralPath C:\ninja-win.zip -DestinationPath C:\ninja"
|
||||||
|
set "PATH=C:\ninja;%PATH%"
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- md build && cd build
|
- cmd: |
|
||||||
- if not %compiler%==mingw ( set "CFLAGS=/MP%simultaneous% %CFLAGS%" )
|
if %compiler%==mingw-Win32 (
|
||||||
- if not %compiler%==mingw ( set "CPPFLAGS=/MP%simultaneous% %CPPFLAGS%" )
|
if %arch%==386 (
|
||||||
- if not %compiler%==mingw ( set "CXXFLAGS=/MP%simultaneous% %CXXFLAGS%" )
|
set "PATH=C:\msys64\mingw32\bin;%PATH%"
|
||||||
- cmake -G "%CMAKE_GENERATOR%" %CMAKE_FLAGS% ..
|
) else (
|
||||||
- if %compiler%==mingw ( mingw32-make -j%simultaneous% tester examples )
|
set "PATH=C:\msys64\mingw64\bin;%PATH%"
|
||||||
else ( msbuild libui.sln /t:Build /p:Configuration=Release /p:Platform=%platform% )
|
)
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
) else (
|
||||||
|
if %arch%==386 (
|
||||||
|
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
|
||||||
|
) else (
|
||||||
|
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
|
||||||
|
)
|
||||||
|
)
|
||||||
|
meson setup build --buildtype=release --default-library=%libtype%
|
||||||
|
ninja -C build
|
||||||
|
|
||||||
after_build:
|
after_build:
|
||||||
- if %platform%==x64 ( set "arch=amd64" ) else ( set "arch=386" )
|
- cmd: |
|
||||||
- if %APPVEYOR_REPO_TAG%==true ( set "version=%APPVEYOR_REPO_TAG_NAME%" )
|
if %APPVEYOR_REPO_TAG%==true (
|
||||||
else ( set "version=%APPVEYOR_REPO_BRANCH%" )
|
set "version=%APPVEYOR_REPO_TAG_NAME%"
|
||||||
- if %linking%==shared ( set "artifact=shared" ) else ( set "artifact=%compiler%-static" )
|
) else (
|
||||||
- set "artifact=%version%-windows-%arch%-%artifact%"
|
set "version=%APPVEYOR_REPO_BRANCH%"
|
||||||
- del .\%outdir%\libui.exp # remove unnecessary files
|
)
|
||||||
- 7z a libui-%artifact%.zip .\%outdir%\libui.* ui.h ui_windows.h
|
set "artifact=%version%-windows-%arch%-%compiler%-
|
||||||
- 7z l libui-%artifact%.zip
|
%libtype%"
|
||||||
- 7z a examples-%artifact%.zip .\%outdir%\*.exe
|
pushd build\meson-out
|
||||||
- 7z l examples-%artifact%.zip
|
if %buildtype%==static (
|
||||||
|
rem TODO msvc only?
|
||||||
|
ren libui.a libui.lib
|
||||||
|
)
|
||||||
|
copy ..\..\ui.h .
|
||||||
|
copy ..\..\ui_windows.h .
|
||||||
|
rem remove unnecessary files
|
||||||
|
rem TODO should we do this on Azure too?
|
||||||
|
del libui.exp
|
||||||
|
7z a "%APPVEYOR_BUILD_FOLDER%\libui-%artifact%.zip" %libfiles% ui.h ui_windows.h
|
||||||
|
7z a "%APPVEYOR_BUILD_FOLDER%\examples-%artifact%.zip" *.exe
|
||||||
|
popd
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: libui-*.zip
|
- path: libui-*.zip
|
||||||
|
|
Loading…
Reference in New Issue