From 20ae968dcf8771d46f2c36222f4397394e5a2535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 18 Dec 2019 14:39:22 +0100 Subject: [PATCH] package/ci: add a Clang-CL build on AppVeyor. --- package/ci/appveyor-desktop.bat | 10 ++++++++-- package/ci/appveyor.yml | 14 ++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/package/ci/appveyor-desktop.bat b/package/ci/appveyor-desktop.bat index ca503bd32..3300045aa 100644 --- a/package/ci/appveyor-desktop.bat +++ b/package/ci/appveyor-desktop.bat @@ -3,6 +3,12 @@ if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" call "C:/Program File if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x64 || exit /b set PATH=%APPVEYOR_BUILD_FOLDER%/openal/bin/Win64;%APPVEYOR_BUILD_FOLDER%\deps\bin;%PATH% +rem need to explicitly specify a 64-bit target, otherwise CMake+Ninja can't +rem figure that out -- https://gitlab.kitware.com/cmake/cmake/issues/16259 +rem for TestSuite we need to enable exceptions explicitly with /EH as these are +rem currently disabled -- https://github.com/catchorg/Catch2/issues/1113 +if "%COMPILER%" == "msvc-clang" set COMPILER_EXTRA=-DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/bin/clang-cl.exe" -DCMAKE_LINKER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/Llvm/bin/lld-link.exe" -DCMAKE_CXX_FLAGS="-m64 /EHsc" + rem Build Corrade git clone --depth 1 git://github.com/mosra/corrade.git || exit /b cd corrade || exit /b @@ -13,7 +19,7 @@ cmake .. ^ -DWITH_INTERCONNECT=OFF ^ -DUTILITY_USE_ANSI_COLORS=ON ^ -DBUILD_STATIC=%BUILD_STATIC% ^ - -G Ninja || exit /b + %COMPILER_EXTRA% -G Ninja || exit /b cmake --build . || exit /b cmake --build . --target install || exit /b cd .. && cd .. @@ -49,7 +55,7 @@ cmake .. ^ -DBUILD_GL_TESTS=ON ^ -DBUILD_STATIC=%BUILD_STATIC% ^ -DBUILD_PLUGINS_STATIC=%BUILD_STATIC% ^ - -G Ninja || exit /b + %COMPILER_EXTRA% -G Ninja || exit /b cmake --build . || exit /b rem Test diff --git a/package/ci/appveyor.yml b/package/ci/appveyor.yml index 1278cc92d..92ab221e7 100644 --- a/package/ci/appveyor.yml +++ b/package/ci/appveyor.yml @@ -23,6 +23,10 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 APPVEYOR_JOB_NAME: windows-static-msvc2019 BUILD_STATIC: ON + - TARGET: desktop + COMPILER: msvc-clang + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + APPVEYOR_JOB_NAME: windows-msvc2019-clang - TARGET: desktop COMPILER: mingw APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 @@ -69,6 +73,8 @@ install: - IF "%TARGET%" == "desktop" IF "%COMPILER%" == "mingw" pip install codecov - IF NOT "%BUILD_STATIC%" == "ON" set BUILD_STATIC=OFF +# For ES builds, otherwise the "%COMPILER:~0,4%" below doesn't work, sigh +- IF "%COMPILER%" == "" set COMPILER=msvc # OpenAL - IF NOT "%TARGET%" == "rt" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\openal-soft-1.19.1-bin.zip appveyor DownloadFile https://openal-soft.org/openal-binaries/openal-soft-1.19.1-bin.zip @@ -83,19 +89,19 @@ install: - IF "%TARGET%" == "desktop-gles" set BUILD_APPLICATIONS=NO # SDL2 -- IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER%" == "msvc" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\SDL2-devel-2.0.9-VC.zip appveyor DownloadFile http://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip -- IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER%" == "msvc" 7z x SDL2-devel-2.0.9-VC.zip && ren SDL2-2.0.9 SDL +- IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER:~0,4%" == "msvc" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\SDL2-devel-2.0.9-VC.zip appveyor DownloadFile http://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip +- IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER:~0,4%" == "msvc" 7z x SDL2-devel-2.0.9-VC.zip && ren SDL2-2.0.9 SDL - IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER%" == "mingw" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\SDL2-devel-2.0.9-mingw.tar.gz appveyor DownloadFile http://libsdl.org/release/SDL2-devel-2.0.9-mingw.tar.gz - IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER%" == "mingw" 7z x SDL2-devel-2.0.9-mingw.tar.gz & 7z x SDL2-devel-2.0.9-mingw.tar & ren SDL2-2.0.9 SDL # GLFW - IF "%BUILD_APPLICATIONS%" == "YES" IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\glfw-3.2.1.bin.WIN64.zip appveyor DownloadFile https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN64.zip - IF "%BUILD_APPLICATIONS%" == "YES" 7z x glfw-3.2.1.bin.WIN64.zip && ren glfw-3.2.1.bin.WIN64 glfw && mkdir deps && mkdir deps\lib && mkdir deps\bin && mkdir deps\include && xcopy /e glfw\include\* deps\include\ -- IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER%" == "msvc" copy glfw\lib-vc2015\glfw3.dll deps\bin\ && copy glfw\lib-vc2015\glfw3dll.lib deps\lib\glfw3.lib +- IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER:~0,4%" == "msvc" copy glfw\lib-vc2015\glfw3.dll deps\bin\ && copy glfw\lib-vc2015\glfw3dll.lib deps\lib\glfw3.lib - IF "%BUILD_APPLICATIONS%" == "YES" IF "%COMPILER%" == "mingw" copy glfw\lib-mingw-w64\glfw3.dll deps\bin\ && copy glfw\lib-mingw-w64\libglfw3dll.a deps\lib\libglfw3.a build_script: -- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "msvc" call package\ci\appveyor-desktop.bat +- IF "%TARGET%" == "desktop" IF "%COMPILER:~0,4%" == "msvc" call package\ci\appveyor-desktop.bat - IF "%TARGET%" == "desktop" IF "%COMPILER%" == "mingw" call package\ci\appveyor-desktop-mingw.bat - IF "%TARGET%" == "desktop-gles" call package\ci\appveyor-desktop-gles.bat # Vulkan needs to be in a separate build, because in the future it'll need