Skip to content

Add ios support#102

Open
Markos-Th09 wants to merge 6 commits into
renderbag:mainfrom
Markos-Th09:ios
Open

Add ios support#102
Markos-Th09 wants to merge 6 commits into
renderbag:mainfrom
Markos-Th09:ios

Conversation

@Markos-Th09

@Markos-Th09 Markos-Th09 commented May 25, 2026

Copy link
Copy Markdown

Add support for iOS. and the ASTC texture format.

Comment thread plume_render_interface_types.h Outdated
@IsaacMarovitz

Copy link
Copy Markdown
Contributor

As far as I can tell the ASTC changes have nothing to do with iOS support and should be moved to another PR.

Comment thread plume_apple.mm Outdated
@Markos-Th09

Copy link
Copy Markdown
Author

@DarioSamo @IsaacMarovitz other than that is there anything else to discuss?

@IsaacMarovitz

Copy link
Copy Markdown
Contributor

Do you have a way to run the example projects on iOS?

@Markos-Th09

Markos-Th09 commented May 30, 2026

Copy link
Copy Markdown
Author

Do you have a way to run the example projects on iOS?

Yes, although I did not include it here. I have been also developing a port of Unleashed Recompiled for iOS (hopefully coming soon) and so far these changes have been enough.

Comment thread ios.toolchain.cmake Outdated
@IsaacMarovitz

Copy link
Copy Markdown
Contributor

There seems to be some problems with signing that prevent file_to_c and spirv_cross_msl from working.

@Markos-Th09

Markos-Th09 commented May 30, 2026

Copy link
Copy Markdown
Author

There seems to be some problems with signing that prevent file_to_c and spirv_cross_msl from working.

I didn't use the Xcode generator for building for iOS if you used that. With the make or ninja generators I did not encounter any issues.

Getting it on device is a bit more convoluted this way so I will investigate what is happening with the Xcode generator.

Edit: I made it work with the Xcode generator you can try again.

Fixes a bug where a CMake reconfigure would fail to find SDL2 if it was initially resolved via find_package.

The issue occurred because the lookup function cached the string value of 'PLUME_SDL2_FOUND'. On a reconfigure, `plume_find_sdl2` exited prematurely and never resolved SDL2 again.
@IsaacMarovitz

Copy link
Copy Markdown
Contributor

Can you share the command you used?

cmake -B cmake-ios -G Xcode -DCMAKE_TOOLCHAIN_FILE=./contrib/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DPLUME_BUILD_EXAMPLES=ON

This worked on my machine as far as cmake is concerned, but it tried to compile using macOS system SDL2 which doesn't contain the binaries or headers for iOS.

@Markos-Th09

Markos-Th09 commented Jun 2, 2026

Copy link
Copy Markdown
Author

Can you share the command you used?

cmake -B cmake-ios -G Xcode -DCMAKE_TOOLCHAIN_FILE=./contrib/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DPLUME_BUILD_EXAMPLES=ON

This worked on my machine as far as cmake is concerned, but it tried to compile using macOS system SDL2 which doesn't contain the binaries or headers for iOS.

Sure. I actually used vcpkg to get a build of SDL2 for iOS, so my configure command was:
cmake -B build/ios -DPLUME_BUILD_EXAMPLES=ON -G Xcode -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=contrib/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64

Either clone vcpkg in the same directory and bootstrap it or if you already have it set up just proceed with installing SDL2. The target triple for ios is arm64-ios, so you can use vcpkg install sdl2:arm64-ios or use a proper vcpkg.json.

Should I add vcpkg to this PR?

@Markos-Th09

Copy link
Copy Markdown
Author

@IsaacMarovitz were you able to build it this way?

@Markos-Th09

Copy link
Copy Markdown
Author

@IsaacMarovitz I just wanted to following up on this. Were you able to get the iOS examples building using the vcpkg and the commands shared above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants