Skip to content

Conversation

@withSang
Copy link
Contributor

@withSang withSang commented Oct 15, 2025

This PR enables building a FluidSynth dynamic framework for iOS.

  • The script downloads the iOS CMake toolchain (https://github.com/leetal/ios-cmake) to generate the XCode project to build the framework. Since the toolchain sets CMAKE_SYSTEM_NAME to iOS, some parts of CMakeLists.txt were modified to support that case.
  • Since <CoreAudio/AudioHardware.h> is not available for iOS, SDL3 instead of CoreAudio is built alongside Fluidsynth as the audio driver.

There have been forks that made iOS build possible (like https://github.com/DominusExult/fluidsynth-sans-glib), but they do not support FluidSynth v2.5.0+ since they modified the sources heavily.

I'm an Android / iOS developer working on a music-playing app and have successfully incorporated your library in my app with the build script. I want to contribute back to enable other iOS developers as well to build and use the library easily.

An example app can be provided if needed.
Sadly, I haven't tried Azure CI before. If you can help me a little, I can provide iOS framework CI checks as well.

Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks pretty good, thanks! I really need a CI pipeline for this, otherwise this build script will just become some unmaintained junk of code.

I'm migrating away from AzureCI and prefer to use GitHub Actions by now. Have you had experience with GitHub Actions and could you provide a CI pipeline on your own?

@DominusExult FYI

@withSang
Copy link
Contributor Author

That looks pretty good, thanks! I really need a CI pipeline for this, otherwise this build script will just become some unmaintained junk of code.

I'm migrating away from AzureCI and prefer to use GitHub Actions by now. Have you had experience with GitHub Actions and could you provide a CI pipeline on your own?

@DominusExult FYI

Thank you for responding! I also agree with your point.
I'm familiar with GitHub Actions. I'll let you know again when I submit the CI pipeline as well 😄

@DominusExult
Copy link

I've used an Xcode project that I created from scratch to work for Exult's iOS port. I didn't need to use either CoreAudio or SDL3 to get FluidSynth to put out music. JFYI
Can be found here https://github.com/exult/exult/tree/master/ios. As @derselbst commented, having scripted is the way to go but maybe this gives some helpful insight.

@withSang
Copy link
Contributor Author

I've used an Xcode project that I created from scratch to work for Exult's iOS port. I didn't need to use either CoreAudio or SDL3 to get FluidSynth to put out music. JFYI
Can be found here https://github.com/exult/exult/tree/master/ios. As @derselbst commented, having scripted is the way to go but maybe this gives some helpful insight.

Oh thank you a lot for sharing!! It definitely helped me a lot. In fact, the build script would not be possible without your fluidsynth-sans-glib port 🥰

@derselbst derselbst added the github_actions Pull requests that update GitHub Actions code label Oct 19, 2025
@withSang
Copy link
Contributor Author

withSang commented Oct 20, 2025

@derselbst It took some time to finalize the iOS CI script since it depended on a change in the SDL3 repository (libsdl-org/SDL#14259)
Now I've updated SDL3 upstream, and the iOS build is fine! :-)

@derselbst
Copy link
Member

Really nice, thanks! Two last points: For Android we publish the binaries to allow downstream projects to consume them directly. Would it make sense to do the same for iOS? And if so, how would the folder structure look like?

And: I would probably want to get rid of the ios folder in the repo root, by moving the build script into e.g. contrib/.

@withSang
Copy link
Contributor Author

Really nice, thanks! Two last points: For Android we publish the binaries to allow downstream projects to consume them directly. Would it make sense to do the same for iOS? And if so, how would the folder structure look like?

And: I would probably want to get rid of the ios folder in the repo root, by moving the build script into e.g. contrib/.

Thanks! I've moved the iOS build script to contrib/ as you advised.
I think it is good to zip the whole FluidSynth.xcframework directory at build/build and include it on each release.

@DominusExult
Copy link

Another note on xcframework, you need to make sure to include the dSYM files for distribution.
See the discussion at libsdl-org/SDL#13573 and my accepted pull request for SDL3.

@withSang
Copy link
Contributor Author

Another note on xcframework, you need to make sure to include the dSYM files for distribution.
See the discussion at libsdl-org/SDL#13573 and my accepted pull request for SDL3.

Thanks! I've added it as well :-)

@derselbst derselbst changed the base branch from master to ios October 28, 2025 21:08
Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for your efforts! LGTM, I'll merge it now to the ios branch, to add a build badge to the readme and publish the binaries as mentioned.

@derselbst derselbst merged commit a6d5979 into FluidSynth:ios Oct 28, 2025
46 of 76 checks passed
@derselbst derselbst added this to the 2.5 milestone Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants