Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,42 @@ jobs:
path: |
build/opengothic/*

ios:
runs-on: macos-15
strategy:
fail-fast: false
matrix:
sdk: [iphoneos, iphonesimulator]
env:
DEVELOPER_DIR: /Applications/Xcode_26.0.app/Contents/Developer
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Install dependencies
run: brew install glslang

- name: Configure
run: |
cmake -B build -G Xcode \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=${{ matrix.sdk }} \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO

- name: Build
run: cmake --build build --config ${{ env.BUILD_TYPE }} -j "$(sysctl -n hw.ncpu)"

- name: Check app bundle
run: |
app=build/opengothic/${{ env.BUILD_TYPE }}/Gothic2Notr.app
plutil -lint "$app/Info.plist"
executable=$(plutil -extract CFBundleExecutable raw -o - "$app/Info.plist")
test -x "$app/$executable"
plutil -extract UIApplicationSceneManifest.UISceneConfigurations.UIWindowSceneSessionRoleApplication.0.UISceneConfigurationName raw -o - "$app/Info.plist"

release:
if: startsWith(github.ref, 'refs/tags/')
needs: [setup, linux, linux-deb, windows, macos-arm64, macos-x64]
Expand Down
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ endif()

# the game
if(IOS)
set_directory_properties("${CMAKE_SOURCE_DIR}" PROPERTIES
PROPERTY XCODE_STARTUP_PROJECT "Gothic2Notr")
set(OPENGOTHIC_IOS_BUNDLE_IDENTIFIER "opengothic.gothic2" CACHE STRING
"Bundle identifier for the iOS application")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS Info.plist.in)
set_target_properties(Gothic2Notr PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "Info.plist.in"
MACOSX_BUNDLE_GUI_IDENTIFIER "opengothic.gothic2"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
MACOSX_BUNDLE_GUI_IDENTIFIER "${OPENGOTHIC_IOS_BUNDLE_IDENTIFIER}"
MACOSX_BUNDLE_BUNDLE_NAME "OpenGothic"
MACOSX_BUNDLE_BUNDLE_VERSION 1
MACOSX_BUNDLE_SHORT_VERSION_STRING "1.0"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${OPENGOTHIC_IOS_BUNDLE_IDENTIFIER}"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
endif()

Expand Down
20 changes: 15 additions & 5 deletions Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>com.apple.developer.kernel.increased-memory-limit</key>
<true/>
<key>UILaunchScreen</key>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIColorName</key>
<string>black</string>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>OpenGothic</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchScreen</key>
<dict/>
</dict>
</plist>
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,36 @@ cmake --build ./build --target Gothic2Notr
```
Executables can be located at `OpenGothic/build/opengothic`.

### iOS

Requires Xcode 26 or newer and targets iOS 15 or newer. Clone with submodules
as above, then generate an Xcode project:

```bash
brew install glslang
cmake -S . -B build-ios -G Xcode \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \
-DOPENGOTHIC_IOS_BUNDLE_IDENTIFIER=org.example.opengothic
open build-ios/OpenGothic.xcodeproj
```

Choose the `Gothic2Notr` scheme, select your development team under Signing
& Capabilities, and run on your device. The bundle identifier must be unique
to your signing team. The existing target name also applies to Gothic 1.

For an unsigned build, add `-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO`
when configuring, then run `cmake --build build-ios --config Release`.
The application is generated at `build-ios/opengothic/Release/Gothic2Notr.app`.
Use a separate build directory with `-DCMAKE_OSX_SYSROOT=iphonesimulator`
for the simulator.

Game data is not included. Before launching, copy your installation's
`Data`, `_work`, and `System` folders into the app's Documents directory
using Finder file sharing. Missing game data currently makes the app exit.

### Android
Install dependencies: JDK 17, Gradle 8.9, CMake 3.22.1 or newer, Ninja and the Android SDK with SDK 35, build-tools 35.0.0, NDK 27.0.12077973 and SDK CMake 3.22.1.
Set `JAVA_HOME`, `ANDROID_HOME` and `VULKAN_SDK`. Put Gradle, Ninja and the host Vulkan SDK's `glslangValidator` on `PATH`.
Expand Down
Loading