Add iOS build to CI

Fix iOS build as well as minor Android cleanup since the
problems for both platforms are so similar
This commit is contained in:
Juan Ramos 2023-11-21 16:59:26 -07:00 committed by GitHub
parent 5fcac839ca
commit a7b18c08d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 10 deletions

View file

@ -174,6 +174,30 @@ jobs:
- name: Test (standalone) - name: Test (standalone)
run: bash -c 'cd ./Test && ./runtests' run: bash -c 'cd ./Test && ./runtests'
iOS:
runs-on: macos-13
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: IOS
- run: ./update_glslang_sources.py
# NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
- name: Configure Universal Binary for iOS
run: |
cmake -S . -B build \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_SYSTEM_NAME=iOS \
"-D CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
-G Ninja
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- run: cmake --build build
- run: cmake --install build --prefix /tmp
android: android:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
@ -183,29 +207,24 @@ jobs:
LEGACY: [ON, OFF] LEGACY: [ON, OFF]
steps: steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: '3.7'
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7 - uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- name: Setup ccache - name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10 uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with: with:
key: android-${{ matrix.LEGACY }} key: android-${{ matrix.LEGACY }}
- name: Update Glslang Sources - run: ./update_glslang_sources.py
run: ./update_glslang_sources.py - name: Configure for Android
- name: Configure
run: | run: |
cmake -S . -B build/ --toolchain $ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ cmake -S . -B build/ --toolchain $ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-D CMAKE_BUILD_TYPE=Release \ -D CMAKE_BUILD_TYPE=Release \
-D ANDROID_ABI=armeabi-v7a \ -D ANDROID_ABI=armeabi-v7a \
-D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \ -D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
-D BUILD_TESTING=OFF -G Ninja
env: env:
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build - run: cmake --build build/
run: cmake --build build/ - run: cmake --install build/ --prefix /tmp
emscripten: emscripten:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04

View file

@ -59,7 +59,24 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_BUILD_TYPE "Debug")
endif() endif()
# Currently iOS and Android are very similar.
# They both have their own packaging (APP/APK).
# Which makes regular executables/testing problematic.
#
# Currently the only deliverables for these platforms are
# libraries (either STATIC or SHARED).
#
# Furthermore testing is equally problematic.
if (IOS OR ANDROID)
set(ENABLE_GLSLANG_BINARIES OFF)
set(SPIRV_SKIP_EXECUTABLES ON)
set(ENABLE_CTEST OFF)
set(BUILD_TESTING OFF)
endif()
option(SKIP_GLSLANG_INSTALL "Skip installation") option(SKIP_GLSLANG_INSTALL "Skip installation")
if(NOT ${SKIP_GLSLANG_INSTALL}) if(NOT ${SKIP_GLSLANG_INSTALL})
set(ENABLE_GLSLANG_INSTALL ON) set(ENABLE_GLSLANG_INSTALL ON)
endif() endif()