Skip to content

Add macOS (Apple Silicon) build support#16

Draft
MarcDufresne wants to merge 1 commit into
RecompRando:masterfrom
MarcDufresne:macos-arm64-port
Draft

Add macOS (Apple Silicon) build support#16
MarcDufresne wants to merge 1 commit into
RecompRando:masterfrom
MarcDufresne:macos-arm64-port

Conversation

@MarcDufresne

Copy link
Copy Markdown

Hi! I wanted to play MM in an AP world, but realized even though Zelda64Recomp does work with macOS, this is not the case for the MMRecompRando mod. This PR introduces the necessary changes to support Apple Silicon.

Build APCpp-Glue as a loadable arm64 dylib on macOS:

  • emit APCpp-Glue.dylib without the default "lib" prefix, so the engine resolves the native_libraries manifest entry by bare name (matching the Windows .dll and Linux .so)
  • use an @loader_path rpath (macOS dyld does not understand $ORIGIN) and rewrite the bundled libpython install name, so the dylib is relocatable
  • add PythonStandalone_macOS_arm64.cmake to fetch the aarch64 CPython standalone and wire up its include/link paths

NOTE: The macOS build also needs the size_t->Json::Value disambiguation in APCpp, which is still pending upstream, RecompRando/APCpp#6. Until that merges, .gitmodules temporarily points lib/APCpp at the fork. It will be repointed to the upstream commit once the APCpp PR lands.

This was tested on my M1 Pro MBP, I was able to connect to AP, send/receive items, resume an ongoing game, etc.

To be clear on scope: this only enables building on macOS, it doesn't touch the mod's release process or add any CI, so the current Windows/Linux releases are unaffected. For now it just lets interested users build the macOS lib themselves if they want to play on Apple Silicon, like I did. If you ever decide to ship macOS builds or automate releases with CI down the line in MMRecompRando, I'm happy to help out, but that's totally your call!

Build APCpp-Glue as a loadable arm64 dylib on macOS:
- emit APCpp-Glue.dylib without the default "lib" prefix, so the engine
  resolves the native_libraries manifest entry by bare name (matching the
  Windows .dll and Linux .so)
- use an @loader_path rpath (macOS dyld does not understand $ORIGIN) and
  rewrite the bundled libpython install name, so the dylib is relocatable
- add PythonStandalone_macOS_arm64.cmake to fetch the aarch64 CPython
  standalone and wire up its include/link paths

The macOS build also needs the size_t->Json::Value disambiguation in
APCpp, which is still pending upstream. Until that merges, .gitmodules
temporarily points lib/APCpp at the fork so CI can build; it will be
repointed to the upstream commit once the APCpp PR lands.
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.

1 participant