Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iOS build to CI #3409

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,30 @@ jobs:
- name: Test (standalone)
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:
runs-on: ubuntu-22.04
strategy:
Expand All @@ -183,29 +207,24 @@ jobs:
LEGACY: [ON, OFF]
steps:
- 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
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: android-${{ matrix.LEGACY }}
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
- run: ./update_glslang_sources.py
- name: Configure for Android
run: |
cmake -S . -B build/ --toolchain $ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-D CMAKE_BUILD_TYPE=Release \
-D ANDROID_ABI=armeabi-v7a \
-D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
-D BUILD_TESTING=OFF
-G Ninja
env:
CMAKE_GENERATOR: Ninja
CMAKE_C_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:
runs-on: ubuntu-22.04
Expand Down
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,24 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Debug")
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)
Comment on lines +71 to +72
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For extra context the ndk-builds currently in glslang and spirv-tools also don't create executables. For the aforementioned reasons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this should also speed up our Android / iOS CI in downstream repos since we can avoid building extra executables.


set(ENABLE_CTEST OFF)
set(BUILD_TESTING OFF)
endif()

option(SKIP_GLSLANG_INSTALL "Skip installation")

if(NOT ${SKIP_GLSLANG_INSTALL})
set(ENABLE_GLSLANG_INSTALL ON)
endif()
Expand Down