Skip to content

Enhance iOS support with full simulator integration and universal binaries - #434

Closed
gumaciel wants to merge 25 commits into
utopia-rise:masterfrom
gumaciel:feature/ios-simulator-support
Closed

gumaciel wants to merge 25 commits into
utopia-rise:masterfrom
gumaciel:feature/ios-simulator-support

Conversation

@gumaciel

Copy link
Copy Markdown
Contributor

This PR adds comprehensive support for the iOS Simulator and improves the robustness of the
iOS plugin loading system and build pipeline.

Key Changes

  • iOS Simulator Support:
    • Implemented full support for iOS Simulator builds in the CI/CD pipeline.
    • Added logic for merging and creating universal binaries (XCFrameworks) that support
      both physical iOS devices and simulators.
  • Plugin Loading Robustness:
    • Applied attribute((weak_import)) to load_all_fmod_plugins to handle cases where
      the symbol might not be present at runtime.
    • Added null checks in FmodServer before calling the plugin loader to prevent crashes on
      iOS/Simulator environments when static plugins are missing.
    • Fixed a potential crash by ensuring std::free is only called if the plugin handles
      were successfully allocated.
  • Build System & CI/CD:
    • SConstruct: Updated to ensure clean XCFramework rebuilds, preventing stale artifacts.
    • GitHub Actions: Significantly expanded release.yml to include the ios-simulator target
      and updated the native build action to handle the new architecture.

This commit enables full iOS Simulator support (x86_64 and arm64) for
FMOD GDExtension by implementing the following:

- SConstruct: Added 'ios_simulator' flag to link correct FMOD libs and
  support simulator architecture in builds.
- Export Plugin: Implemented 'simulator' feature detection to correctly
  filter and link architecture-specific static libraries (.a) during export.
- GitHub Actions: Updated build matrix and added a new 'merge-ios-xcframework'
  job to automatically create universal XCFrameworks (device + simulator)
  during release.
- Case Sensitivity: Standardized iOS library paths to lowercase 'ios'.
This commit shifts the iOS simulator/device intelligence from the Godot
exporter to the build/packaging process.

Changes:
- src/tools/fmod_editor_export_plugin.cpp: Removed manual 'simulator'
  feature check; now generically links all static libraries.
- .github/workflows/release.yml: Added a new 'lipo' merging step for all
  FMOD static archives (.a files) to produce universal libraries.
- Result: A single Godot export will now correctly support both iOS
  devices and simulators in a single Xcode project.
@gumaciel

Copy link
Copy Markdown
Contributor Author

I've created a release tag for testing with these changes, and it's working fine for real devices and the simulator:

https://github.com/gumaciel/fmod-gdextension/releases/tag/5.0.12-4.6.2
https://github.com/gumaciel/fmod-gdextension/actions/runs/24812319324

@CedNaru
CedNaru requested review from CedNaru and piiertho April 27, 2026 09:43
build(ios): integrate dsymutil for dSYM generation in xcframework
Fernando-S and others added 4 commits May 7, 2026 19:41
There was a space in line 85 before the gdscript block and this was bugging the webpage.
…by CMake + Moved cmake minimum required definition after project definition (utopia-rise#414)

* updated .gitignore to not track visual studio solution files
* Moved cmake minimum required definition after project definition
…on iOS (utopia-rise#402)

* Bindings for `mixerSuspend` and `mixerResume`
* Call `FmodServer.mixer_suspend` and `FmodServer.mixer_resume` automatically on iOS
* Background muting for all mobile devices

---------

Co-authored-by: Benjamin Davis <518044+raggy@users.noreply.github.com>
The build job creates single-arch xcframeworks with dSYMs, but
the merge-ios-xcframework job was recreating a new multi-arch
xcframework from the raw dylibs without running dsymutil or
passing -debug-symbols. This is the actual fix.
@AdamGerthel

Copy link
Copy Markdown

Is there anything I can do to help get this merged? Do you need help with testing?

@gumaciel

Copy link
Copy Markdown
Contributor Author

@AdamGerthel, sorry, but I don't know. Maybe this is a lot of files to be reviewed, I'm waiting @CedNaru or @piiertho to review, thank you

But if you want to test, you can use this release on my fork: https://github.com/gumaciel/fmod-gdextension/releases/tag/5.0.13-4.6.2

Shaun-Fong added a commit to Shaun-Fong/fmod-gdextension that referenced this pull request Oct 19, 2026
Fixes taken from the open pull requests of utopia-rise/fmod-gdextension:

* utopia-rise#443: keep the UTF-8 converted plugin path alive while FMOD loads it
* utopia-rise#442: return the final parameter value from get_parameter_by_* and fix
  the error messages of the global parameter getters
* utopia-rise#441: do not restart autoplay events when the editor sets the event
* utopia-rise#429: do not dereference a null event description and do not build a
  garbage path when getPath returns FMOD_ERR_EVENT_NOTFOUND
* utopia-rise#417: look the plugins settings up with ResourceLoader so exported
  projects find them
* utopia-rise#434: link with a weak load_all_fmod_plugins on iOS so a project
  without static plugins still links (the rest of utopia-rise#434 is an iOS
  simulator build overhaul and is out of scope here)
* utopia-rise#395: validate the event description before reading parameters

Bugs found while auditing the code base:

* FmodServer::_set_listener_attributes returned instead of continuing on
  a listener outside the tree, so the remaining listeners were skipped
* FmodServer::shutdown released the FMOD system before the event
  instances and deleted the cache while banks could still be referenced,
  leaving dangling handles and crashing on late Ref releases;
  FmodBank::~FmodBank now also checks the server singleton
* load_bank, unload_bank and banks_still_loading dereferenced the cache
  without a null check, and unload_bank refused to unload banks that are
  packed in the PCK because of a FileAccess::file_exists check
* get_global_parameter_desc_list truncated its result to 256 entries and
  the performance counters overflowed after 2 GiB of reads
* The asynchronous file reader waited on a condition variable without a
  predicate and could miss a notification, which blocked the read thread
  forever; the thread now drains pending requests when it stops
* godotFileOpen dereferenced the Ref returned by FileAccess::open even
  when the open failed, and godotFileClose dereferenced a null handle
* The event callbacks dereferenced the server singleton, the event user
  data and the programmer sound without null checks
* FmodEventDescription::get_instance_list built a Ref from an
  uninitialized pointer, and the parameter label getters returned an
  uninitialized buffer when the FMOD call failed
* string_to_fmod_guid left the GUID uninitialized when the string did not
  parse, and FMODCLASSWITHPATH read the path of a failed getPath
* FmodEvent::set_node_attributes dereferenced a null node and
  FmodSound::is_valid tested an uninitialized bool on a null handle
* The logging settings enum hint was off by one, so DEBUG_INHERIT was
  missing from the inspector and DEBUG_VERBOSE could not be selected
* D_METHOD argument name typos in FmodEventEmitter and
  FmodEventDescription

Release workflow: replace the archived node12 release actions
(actions/create-release@v1 and actions/upload-release-asset@v1) with
softprops/action-gh-release@v2, use checkout@v4 and grant contents: write
so the tag build can publish its assets.
@CedNaru

CedNaru commented Nov 3, 2026

Copy link
Copy Markdown
Member

Superseded by PR #454

@CedNaru CedNaru closed this Nov 3, 2026

This branch was previously deployed

1 inactive deployment
external-pr — c3dcb414 Deployed May 7, 2026 by gumaciel via gate #473
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.

7 participants