Skip to content

Commit

Permalink
package/ci: build minimal Vulkan support on Linux and Windows.
Browse files Browse the repository at this point in the history
Disabling everything that doesn't depend on Vulkan as it's not needed to
be built again -- that's basically everything right now. This needs to
be a separate build for the foreseeable future, because it requires a
newer CMake version for the Find module and it'll probably also require
newer C++ standard.

Thanks to @LB-- for providing me with an oneliner to compile a file with
cl.exe.
  • Loading branch information
mosra committed Aug 27, 2018
1 parent 2bfee42 commit d578d4d
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Listing only people with code contributions, because otherwise there's too many
initial macOS port, various other improvements
- Nathan Ollerenshaw ([@matjam](https://github.com/matjam)) --- Ubuntu
packages in a PPA repository
- Nicholas "LB" Branden ([@LB--](https://github.com/LB--)) -- warning fixes
- Nicholas "LB" Branden ([@LB--](https://github.com/LB--)) -- warning fixes,
Windows buildsystem improvements
- Olga Turanksaya ([@olga-python](https://github.com/olga-python)) -- Gentoo
ebuild
- Sam Spilsbury ([@smspillaz](https://github.com/smspillaz)) -- WebGL and
Expand Down
66 changes: 66 additions & 0 deletions package/ci/appveyor-desktop-vulkan.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" x64 || exit /b
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 Build Corrade
git clone --depth 1 git://github.com/mosra/corrade.git || exit /b
cd corrade || exit /b
mkdir build && cd build || exit /b
cmake .. ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^
-DWITH_INTERCONNECT=OFF ^
-DUTILITY_USE_ANSI_COLORS=ON ^
-G Ninja || exit /b
cmake --build . || exit /b
cmake --build . --target install || exit /b
cd .. && cd ..

rem Build the fastest Vulkan driver ever. See appveyor.yml for why Vulkan is
rem a separate build for now.
cl.exe /c package/ci/libvulkan.cpp || exit /b
lib.exe /OUT:%APPVEYOR_BUILD_FOLDER%/deps/lib/libvulkan.lib libvulkan.obj || exit /b

rem Enabling only stuff that's directly affected by Vulkan, disabling
rem everything else.
mkdir build && cd build || exit /b
cmake .. ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^
-DVulkan_LIBRARY=%APPVEYOR_BUILD_FOLDER%/deps/lib/libvulkan.lib ^
-DWITH_AUDIO=OFF ^
-DWITH_DEBUGTOOLS=OFF ^
-DWITH_GL=OFF ^
-DWITH_MESHTOOLS=OFF ^
-DWITH_PRIMITIVES=OFF ^
-DWITH_SCENEGRAPH=OFF ^
-DWITH_SHADERS=OFF ^
-DWITH_SHAPES=OFF ^
-DWITH_TEXT=OFF ^
-DWITH_TEXTURETOOLS=OFF ^
-DWITH_TRADE=OFF ^
-DWITH_VK=ON ^
-DWITH_ANYAUDIOIMPORTER=OFF ^
-DWITH_ANYIMAGECONVERTER=OFF ^
-DWITH_ANYIMAGEIMPORTER=OFF ^
-DWITH_ANYSCENEIMPORTER=OFF ^
-DWITH_MAGNUMFONT=OFF ^
-DWITH_MAGNUMFONTCONVERTER=OFF ^
-DWITH_OBJIMPORTER=OFF ^
-DWITH_TGAIMAGECONVERTER=OFF ^
-DWITH_TGAIMPORTER=OFF ^
-DWITH_WAVAUDIOIMPORTER=OFF ^
-DWITH_DISTANCEFIELDCONVERTER=OFF ^
-DWITH_FONTCONVERTER=OFF ^
-DWITH_IMAGECONVERTER=OFF ^
-DWITH_GL_INFO=OFF ^
-DWITH_AL_INFO=OFF ^
-DBUILD_TESTS=ON ^
-DBUILD_GL_TESTS=OFF ^
-G Ninja || exit /b
cmake --build . || exit /b
cmake --build . --target install || exit /b

rem Test
set CORRADE_TEST_COLOR=ON
ctest -V -E GLTest || exit /b
8 changes: 8 additions & 0 deletions package/ci/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ environment:
COMPILER: msvc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
APPVEYOR_JOB_NAME: windows-gl-msvc2017
- TARGET: desktop-vulkan
COMPILER: msvc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
APPVEYOR_JOB_NAME: windows-vulkan-msvc2017
- TARGET: desktop
COMPILER: mingw
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
Expand Down Expand Up @@ -83,6 +87,10 @@ build_script:
- IF "%TARGET%" == "desktop" IF "%COMPILER%" == "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
# C++14 and building it together with C++11 code would harm verifiability of
# C++11 compatibility.
- IF "%TARGET%" == "desktop-vulkan" call package\ci\appveyor-desktop-vulkan.bat
- IF "%TARGET%" == "rt" call package\ci\appveyor-rt.bat

cache:
Expand Down
27 changes: 23 additions & 4 deletions package/ci/travis-desktop-vulkan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ cmake .. \
ninja install
cd ../..

# The fastest Vulkan driver ever. See travis.yml for why we have a separate
# Vulkan build.
g++ package/ci/libvulkan.cpp -std=c++11 -shared -o $HOME/libvulkan.so

# Enabling only stuff that's directly affected by Vulkan, disabling everything
# else.
mkdir build && cd build
# Not using CXXFLAGS in order to avoid affecting dependencies
cmake .. \
Expand All @@ -29,17 +35,30 @@ cmake .. \
-DWITH_GL=OFF \
-DWITH_MESHTOOLS=OFF \
-DWITH_PRIMITIVES=OFF \
-DWITH_SCENEGRAPH=ON \
-DWITH_SCENEGRAPH=OFF \
-DWITH_SHADERS=OFF \
-DWITH_SHAPES=ON \
-DWITH_SHAPES=OFF \
-DWITH_TEXT=OFF \
-DWITH_TEXTURETOOLS=OFF \
-DWITH_TRADE=OFF \
-DWITH_VK=ON \
-DWITH_AL_INFO=OFF \
-DWITH_VK_INFO=ON \
-DWITH_GL_INFO=OFF \
-DWITH_ANYAUDIOIMPORTER=OFF \
-DWITH_ANYIMAGECONVERTER=OFF \
-DWITH_ANYIMAGEIMPORTER=OFF \
-DWITH_ANYSCENEIMPORTER=OFF \
-DWITH_MAGNUMFONT=OFF \
-DWITH_MAGNUMFONTCONVERTER=OFF \
-DWITH_OBJIMPORTER=OFF \
-DWITH_TGAIMAGECONVERTER=OFF \
-DWITH_TGAIMPORTER=OFF \
-DWITH_WAVAUDIOIMPORTER=OFF \
-DWITH_DISTANCEFIELDCONVERTER=OFF \
-DWITH_FONTCONVERTER=OFF \
-DWITH_IMAGECONVERTER=OFF \
-DBUILD_TESTS=ON \
-DBUILD_VK_TESTS=ON \
-DBUILD_GL_TESTS=OFF \
-DBUILD_DEPRECATED=$BUILD_DEPRECATED \
-G Ninja
# Otherwise the job gets killed (probably because using too much memory)
Expand Down
6 changes: 3 additions & 3 deletions package/ci/travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ install:
# supporting that. Latest GLFW is tested on macOS.
- if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ) && [ ! -e "$HOME/glfw/include" ]; then wget https://github.com/glfw/glfw/releases/download/3.1.2/glfw-3.1.2.zip && unzip glfw-3.1.2.zip && cd glfw-3.1.2 && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/glfw -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DBUILD_SHARED_LIBS=ON && cmake --build . --target install && cd ../..; fi

# Vulkan (eheh)
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-vulkan" ]; then g++ package/ci/libvulkan.cpp -std=c++11 -shared -o $HOME/libvulkan.so; fi

script:
- if [ "$TRAVIS_OS_NAME" == "linux" ] && ( [ "$TARGET" == "desktop" ] || [ "$TARGET" == "desktop-sanitizers" ] ); then ./package/ci/travis-desktop.sh; fi
# Vulkan needs to be in a separate build, because it needs new CMake (for the
# Find module) and in the future also C++14. Unfortunately that means we can't
# apply the sanitizer or non-deprecated build on it.
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-vulkan" ]; then ./package/ci/travis-desktop-vulkan.sh; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "desktop-gles" ]; then ./package/ci/travis-desktop-gles.sh; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TARGET" == "android" ]; then ./package/ci/travis-android-arm.sh; fi
Expand Down

0 comments on commit d578d4d

Please sign in to comment.