Skip to content

Commit 082b5f6

Browse files
authored
Merge pull request #115 from luadebug/iphone
Add iOS support
2 parents 852bf5c + 735a565 commit 082b5f6

File tree

3 files changed

+75
-3
lines changed

3 files changed

+75
-3
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,47 @@ jobs:
122122
run: ./out/Release/unit_tests
123123

124124
##############################################################################
125-
# 4) FreeBSD – Clang / Ninja
125+
# 4) iOS – AppleClang / Xcode / arm64-ios
126+
##############################################################################
127+
ios-build:
128+
name: iOS (AppleClang) (arm64-ios)
129+
runs-on: macOS-latest
130+
env:
131+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
132+
steps:
133+
- name: Install CMake tooling
134+
shell: bash
135+
run: |
136+
brew install cmake ninja
137+
138+
- name: Checkout repository (with sub-modules)
139+
uses: actions/checkout@v4
140+
with:
141+
submodules: recursive
142+
143+
- name: Set up vcpkg
144+
shell: bash
145+
run: |
146+
git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT"
147+
cd "$VCPKG_ROOT"
148+
./bootstrap-vcpkg.sh
149+
150+
- name: Configure (cmake --preset)
151+
shell: bash
152+
run: |
153+
cmake --preset ios-release-vcpkg \
154+
-DVCPKG_INSTALL_OPTIONS="--allow-unsupported" \
155+
-DOMATH_BUILD_TESTS=ON \
156+
-DOMATH_BUILD_BENCHMARK=OFF \
157+
-DVCPKG_MANIFEST_FEATURES="imgui;tests"
158+
159+
- name: Build
160+
shell: bash
161+
run: |
162+
cmake --build cmake-build/build/ios-release-vcpkg --config Release --target unit_tests omath
163+
164+
##############################################################################
165+
# 5) FreeBSD – Clang / Ninja
126166
##############################################################################
127167
freebsd-build-and-test:
128168
name: FreeBSD (Clang) (x64-freebsd)

CMakePresets.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,38 @@
179179
"CMAKE_BUILD_TYPE": "Release"
180180
}
181181
},
182+
{
183+
"name": "ios-base",
184+
"hidden": true,
185+
"generator": "Ninja",
186+
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
187+
"cacheVariables": {
188+
"CMAKE_SYSTEM_NAME": "iOS",
189+
"CMAKE_OSX_DEPLOYMENT_TARGET": "18.5",
190+
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED": "NO",
191+
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED": "NO"
192+
},
193+
"condition": {
194+
"type": "equals",
195+
"lhs": "${hostSystemName}",
196+
"rhs": "Darwin"
197+
}
198+
},
199+
{
200+
"name": "ios-base-vcpkg",
201+
"hidden": true,
202+
"inherits": "ios-base",
203+
"cacheVariables": {
204+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
205+
"VCPKG_TARGET_TRIPLET": "arm64-ios",
206+
"VCPKG_HOST_TRIPLET": "arm64-osx"
207+
}
208+
},
209+
{
210+
"name": "ios-release-vcpkg",
211+
"displayName": "iOS Release (vcpkg)",
212+
"inherits": "ios-base-vcpkg"
213+
},
182214
{
183215
"name": "freebsd-base",
184216
"hidden": true,

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ else() # GTest is being linked as vcpkg package
2424
endif()
2525

2626
# Skip test discovery for Android builds - binaries cannot run on host
27-
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
27+
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "iOS"))
2828
gtest_discover_tests(${PROJECT_NAME})
29-
endif()
29+
endif()

0 commit comments

Comments
 (0)