Add iOS support

This commit is contained in:
Saikari
2025-12-16 14:48:20 +03:00
parent 852bf5c56f
commit 735a565446
3 changed files with 75 additions and 3 deletions

View File

@@ -122,7 +122,47 @@ jobs:
run: ./out/Release/unit_tests
##############################################################################
# 4) FreeBSD Clang / Ninja
# 4) iOS AppleClang / Xcode / arm64-ios
##############################################################################
ios-build:
name: iOS (AppleClang) (arm64-ios)
runs-on: macOS-latest
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- name: Install CMake tooling
shell: bash
run: |
brew install cmake ninja
- name: Checkout repository (with sub-modules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up vcpkg
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT"
cd "$VCPKG_ROOT"
./bootstrap-vcpkg.sh
- name: Configure (cmake --preset)
shell: bash
run: |
cmake --preset ios-release-vcpkg \
-DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \
-DOMATH_BUILD_TESTS=ON \
-DOMATH_BUILD_BENCHMARK=OFF \
-DVCPKG_MANIFEST_FEATURES="imgui;tests"
- name: Build
shell: bash
run: |
cmake --build cmake-build/build/ios-release-vcpkg --config Release --target unit_tests omath
##############################################################################
# 5) FreeBSD Clang / Ninja
##############################################################################
freebsd-build-and-test:
name: FreeBSD (Clang) (x64-freebsd)

View File

@@ -179,6 +179,38 @@
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ios-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "iOS",
"CMAKE_OSX_DEPLOYMENT_TARGET": "18.5",
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED": "NO",
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED": "NO"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "ios-base-vcpkg",
"hidden": true,
"inherits": "ios-base",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "arm64-ios",
"VCPKG_HOST_TRIPLET": "arm64-osx"
}
},
{
"name": "ios-release-vcpkg",
"displayName": "iOS Release (vcpkg)",
"inherits": "ios-base-vcpkg"
},
{
"name": "freebsd-base",
"hidden": true,

View File

@@ -24,6 +24,6 @@ else() # GTest is being linked as vcpkg package
endif()
# Skip test discovery for Android builds - binaries cannot run on host
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "iOS"))
gtest_discover_tests(${PROJECT_NAME})
endif()