diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 03eade9286..28d9c49794 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -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: @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index c856455bdc..c8d215ca7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) + + 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()