Skip to content

Commit

Permalink
package/ci: add an iOS GLES3 build.
Browse files Browse the repository at this point in the history
I don't think GLES2 is worth bothering with on this platform, given that
GL as a whole is deprecated by that company.
  • Loading branch information
mosra committed Feb 14, 2022
1 parent a7b94a4 commit d3a411c
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
12 changes: 12 additions & 0 deletions package/ci/circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,17 @@ jobs:
- build:
script: android-x86-vulkan.sh

ios-gles3:
executor: xcode-11_4
environment:
# STUPID yml interprets unquoted ON as a boolean
TARGET_GLES2: "OFF"
steps:
- install-base-macos:
extra: xcbeautify
- build:
script: ios-simulator-gles.sh

workflows:
version: 2
build:
Expand All @@ -583,3 +594,4 @@ workflows:
- android-x86-gles2
- android-x86-gles3
- android-x86-vulkan
- ios-gles3
88 changes: 88 additions & 0 deletions package/ci/ios-simulator-gles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash
set -ev

git submodule update --init

# Corrade
git clone --depth 1 https://github.com/mosra/corrade.git
cd corrade

# Build native corrade-rc
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$HOME/deps-native \
-DWITH_INTERCONNECT=OFF \
-DWITH_PLUGINMANAGER=OFF \
-DWITH_TESTSUITE=OFF \
-DWITH_UTILITY=OFF \
-G Ninja
ninja install
cd ..

# Crosscompile Corrade
mkdir build-ios && cd build-ios
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/generic/iOS.cmake \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \
-DCMAKE_INSTALL_PREFIX=$HOME/deps \
-DBUILD_STATIC=ON \
-DTESTSUITE_TARGET_XCTEST=ON \
-DWITH_INTERCONNECT=OFF \
-G Xcode
set -o pipefail && cmake --build . --config Release --target install | xcbeautify
cd ../..

# Crosscompile SDL. On 2022-14-02 curl says the certificate is expired, so
# ignore that.
# TODO use a CMake build instead
curl --insecure -O https://www.libsdl.org/release/SDL2-2.0.10.tar.gz
tar -xzvf SDL2-2.0.10.tar.gz
cd SDL2-2.0.10/Xcode-iOS/SDL
set -o pipefail && xcodebuild -sdk iphonesimulator13.4 | xcbeautify
cp build/Release-iphonesimulator/libSDL2.a $HOME/deps/lib
mkdir -p $HOME/deps/include/SDL2
cp -R ../../include/* $HOME/deps/include/SDL2
cd ../../..

# Crosscompile Magnum
mkdir build-ios && cd build-ios
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \
-DCMAKE_PREFIX_PATH="$HOME/deps" \
-DTARGET_GLES2=$TARGET_GLES2 \
-DWITH_AUDIO=ON \
-DWITH_VK=OFF \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSIOSAPPLICATION=ON \
-DWITH_EGLCONTEXT=ON \
-DWITH_OPENGLTESTER=ON \
-DWITH_ANYAUDIOIMPORTER=ON \
-DWITH_ANYIMAGECONVERTER=ON \
-DWITH_ANYIMAGEIMPORTER=ON \
-DWITH_ANYSCENECONVERTER=ON \
-DWITH_ANYSCENEIMPORTER=ON \
-DWITH_ANYSHADERCONVERTER=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_OBJIMPORTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
-DWITH_WAVAUDIOIMPORTER=ON \
-DBUILD_STATIC=ON \
-DBUILD_TESTS=ON \
-DBUILD_GL_TESTS=ON \
-G Xcode
set -o pipefail && cmake --build . --config Release | xcbeautify
# TODO: find a better way to avoid
# Library not loaded: /System/Library/Frameworks/OpenGLES.framework/OpenGLES
# error
DYLD_FALLBACK_LIBRARY_PATH="/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/OpenGLES.framework" DYLD_FALLBACK_FRAMEWORK_PATH="/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks" CORRADE_TEST_COLOR=ON ctest -V -C Release -E "GLTest|GLBenchmark"

# Test install, after running the tests as for them it shouldn't be needed
set -o pipefail && cmake --build . --config Release --target install | xcbeautify

0 comments on commit d3a411c

Please sign in to comment.