[Agent] feat(mupen64plus): add XcodeGen project.yml for dual SPM+Xcode builds#3465
[Agent] feat(mupen64plus): add XcodeGen project.yml for dual SPM+Xcode builds#3465github-actions[bot] wants to merge 11 commits into
Conversation
|
🤖 PR created. AI review starting automatically. |
There was a problem hiding this comment.
Pull request overview
Adds an XcodeGen spec for the Mupen64Plus core package to support generating an Xcode project alongside the existing SwiftPM build, plus a changelog fragment documenting the addition.
Changes:
- Introduces
Cores/Mupen64Plus/project.ymldefining 11 XcodeGen targets intended to mirrorPackage.swift. - Adds a
.changelog/2856.mdfragment describing the new XcodeGen support.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
Cores/Mupen64Plus/project.yml |
New XcodeGen project spec for dual SPM + generated-Xcode builds of Mupen64Plus and plugins |
.changelog/2856.md |
Changelog entry for adding XcodeGen support |
| settings: | ||
| base: | ||
| ALLOW_TARGET_PLATFORM_SPECIALIZATION: YES | ||
| SUPPORTED_PLATFORMS: "iphoneos iphonesimulator appletvos appletvsimulator" | ||
| SWIFT_VERSION: "5.0" | ||
| CLANG_CXX_LANGUAGE_STANDARD: "gnu++11" | ||
| GCC_C_LANGUAGE_STANDARD: "gnu99" | ||
| # Common preprocessor defines (all platforms) | ||
| GCC_PREPROCESSOR_DEFINITIONS: | ||
| - "$(inherited)" | ||
| - "__unix__=1" | ||
| - "GCC=1" | ||
| - "GLES_SILENCE_DEPRECATION=1" | ||
| - "GL_SILENCE_DEPRECATION=1" | ||
| - "M64P_PLUGIN_PROTOTYPES=1" | ||
| - "MUPENPLUSAPI=1" | ||
| - "M64P_PLUGIN_API=1" | ||
| - "IN_OPENEMU=1" | ||
| - "PIC=1" | ||
| - "M64P_PARALLEL=1" | ||
| - "NO_ASM=1" | ||
| - "PROVENANCE=1" | ||
| - "TXFILTER_LIB=1" | ||
| - "VFP_HARD=1" | ||
| OTHER_CFLAGS: "$(inherited) -fno-strict-aliasing -fvisibility=hidden -fomit-frame-pointer -fvisibility-inlines-hidden -fPIC" |
There was a problem hiding this comment.
settings.base is described as mirroring sharedCSettings from Package.swift, but it omits several SDK-specific build settings currently provided by Config.xcconfig (e.g. GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] for OS_IOS/GLESX/USE_GLES/NEON, and the tvOS simulator EXCLUDED_SOURCE_FILE_NAMES/INCLUDED_SOURCE_FILE_NAMES rules). Without pulling in Config.xcconfig (via XcodeGen configFiles) or re-expressing those as conditional build settings in YAML, the generated project will compile with different flags and likely fail or behave differently on sim/device.
| dependencies: | ||
| - target: PVMupenBridge | ||
| - target: PVMupen64PlusCore | ||
| - target: PVRSPCXD4 | ||
| settings: |
There was a problem hiding this comment.
PVMupen depends on several external package products in Package.swift (PVAudio, PVCoreBridge, PVEmulatorCore, PVSupport, PVLogging, PVPlists, PVCoreObjCBridge, etc.), but this XcodeGen spec only lists intra-project target dependencies and does not define any packages: entries. As-is, the generated project won’t build because those modules won’t be resolvable; add the local package references and declare them as target dependencies.
| linkerFlags: | ||
| - "-lz" |
There was a problem hiding this comment.
linkerFlags: is not a supported XcodeGen key under settings (XcodeGen expects build setting names like OTHER_LDFLAGS or dependencies: - sdk: libz.tbd). This will be ignored or cause spec validation errors, and -lz may not be linked as intended.
| linkerFlags: | ||
| - "-lz" | ||
| sdk: | ||
| iOS: | ||
| OTHER_LDFLAGS: "-framework OpenGLES" |
There was a problem hiding this comment.
linkerFlags: and settings.sdk: are not valid in XcodeGen’s settings schema. If you need -lz / OpenGLES linkage, express it via supported build settings (e.g. OTHER_LDFLAGS with [sdk=...] conditionals) and/or dependencies: - sdk: .... As written, XcodeGen will ignore or reject these keys and the target may fail to link.
| linkerFlags: | ||
| - "-lz" |
There was a problem hiding this comment.
linkerFlags: is not a supported XcodeGen key under settings (same issue as other targets). Use a supported approach like dependencies: - sdk: libz.tbd or set OTHER_LDFLAGS in settings.base.
| @@ -0,0 +1,2 @@ | |||
| ### Added | |||
| - **Mupen64Plus XcodeGen support** — Added `project.yml` for the Mupen64Plus core package, enabling Xcode project regeneration via `xcodegen generate` alongside the existing SPM `Package.swift` build path. Both build paths are now supported side-by-side. | |||
There was a problem hiding this comment.
Changelog fragment entries should be plain English with no trailing period (see .changelog/README.md). This bullet ends with a period and is multiple sentences; please trim to a single sentence and drop the trailing punctuation to match consolidation style.
| - **Mupen64Plus XcodeGen support** — Added `project.yml` for the Mupen64Plus core package, enabling Xcode project regeneration via `xcodegen generate` alongside the existing SPM `Package.swift` build path. Both build paths are now supported side-by-side. | |
| - **Mupen64Plus XcodeGen support** — Added `project.yml` for the Mupen64Plus core package to enable Xcode project regeneration via `xcodegen generate` alongside the existing SPM `Package.swift` build path, supporting both build paths side-by-side |
| linkerFlags: | ||
| - "-lz" |
There was a problem hiding this comment.
linkerFlags: is not a supported XcodeGen key under settings (same schema issue as in other targets). Use supported build settings (e.g. OTHER_LDFLAGS) or an SDK dependency (libz.tbd) to ensure zlib is linked.
| # glidenhq — GlideN64 texture enhancement library | ||
| # =========================================================================== | ||
| glidenhq: | ||
| type: framework |
There was a problem hiding this comment.
glidenhq is declared as type: framework, but the existing PVMupen64Plus.xcodeproj builds it as a static library (com.apple.product-type.library.static). If the goal is a drop-in replacement for the current project, consider type: library.static here as well to keep linking/embedding consistent.
| type: framework | |
| type: library.static |
| base: | ||
| ALLOW_TARGET_PLATFORM_SPECIALIZATION: YES | ||
| SUPPORTED_PLATFORMS: "iphoneos iphonesimulator appletvos appletvsimulator" | ||
| SWIFT_VERSION: "5.0" |
There was a problem hiding this comment.
This spec sets SWIFT_VERSION to 5.0, but the package uses // swift-tools-version: 6.0 in Package.swift. For consistency with the package toolchain, consider removing this override (inherit Xcode’s default) or updating it to Swift 6; forcing Swift 5 language mode here can cause the XcodeGen build to diverge from the SPM build.
| SWIFT_VERSION: "5.0" | |
| SWIFT_VERSION: "6.0" |
| # libpng — PNG library (bundled) | ||
| # =========================================================================== | ||
| libpng: | ||
| type: framework |
There was a problem hiding this comment.
libpng is declared as type: framework, but the existing PVMupen64Plus.xcodeproj builds libpng as a static library (com.apple.product-type.library.static). If this XcodeGen project is intended to replace/align with the current project output, consider switching this target to type: library.static to avoid changing the artifact type and embedding/linking behavior.
| type: framework | |
| type: library.static |
|
@claude please validate copilot review issues, improve, fix and then self-re review and mark copilot for re-review |
|
Fixes applied - see PR comment for details. Awaiting Copilot re-review. |
|
✅ Fixes pushed — addressed all 10 Copilot review comments:
|
|
✅ Fixes pushed — addressed all remaining Copilot review issues Changes made in this round:
|
| - "osal_dynamiclib_unix.c" | ||
| - "osal_files_unix.c" | ||
| dependencies: | ||
| - target: libpng |
There was a problem hiding this comment.
PVMupen64PlusVideoRice is missing the SDL target dependency, but in Package.swift it depends on SDL and the Rice sources include/use SDL APIs. Without linking SDLStubs.m, the XcodeGen build is likely to fail with undefined SDL symbols. Add - target: SDL to this target’s dependencies (or otherwise ensure SDL stubs are linked).
| - target: libpng | |
| - target: libpng | |
| - target: SDL |
| # Allow multi-platform targets | ||
| allowedOverridesForPlatformSpecialization: true |
There was a problem hiding this comment.
options.allowedOverridesForPlatformSpecialization is not a valid XcodeGen project spec key (XcodeGen 2.36+). This will cause xcodegen generate to fail or ignore the intended behavior. Remove this option; multi-platform targets are already covered by platform: [iOS, tvOS] (or use supportedDestinations if you adopt a newer XcodeGen).
| # Allow multi-platform targets | |
| allowedOverridesForPlatformSpecialization: true |
| excludes: | ||
| - "CorePlist-Generated.swift" | ||
| dependencies: | ||
| - target: PVMupenBridge | ||
| - target: PVMupen64PlusCore |
There was a problem hiding this comment.
PVMupen excludes CorePlist-Generated.swift, but CorePlist.swift references the generated CorePlist enum. With this exclusion the XcodeGen-generated project will fail to compile unless you add a build script to generate and include that file from Derived Sources. Either include CorePlist-Generated.swift in sources, or add a SwiftGen build step and point its output to a compiled sources directory.
| excludes: | |
| - "CorePlist-Generated.swift" | |
| dependencies: | |
| - target: PVMupenBridge | |
| - target: PVMupen64PlusCore | |
| dependencies: | |
| - target: PVMupenBridge | |
| - target: PVMupen64PlusCore | |
| - target: PVMupenBridge | |
| - target: PVMupen64PlusCore |
|
@claude please validate copilot review issues, improve, fix and then self-re review and mark copilot for re-review |
|
✅ Fixes pushed — addressed all actionable Copilot review issues Changes made to
Pre-existing / already-correct items (no changes needed):
|
|
✅ Fixes pushed — addressed all 3 Copilot review comments from second review:
|
| OTHER_CFLAGS: "$(inherited) -fno-strict-aliasing -fvisibility=hidden -fomit-frame-pointer -fvisibility-inlines-hidden -fPIC" | ||
| # SDK-specific OTHER_CFLAGS (mirrors Config.xcconfig) | ||
| "OTHER_CFLAGS[sdk=iphoneos*]": "$(inherited) -DOS_IOS -D__VEC4_OPT -D__NEON_OPT" | ||
| "OTHER_CFLAGS[sdk=iphonesimulator*]": "$(inherited) -DOS_IOS" | ||
| "OTHER_CFLAGS[sdk=appletvos*]": "$(inherited) -DOS_IOS -D__VEC4_OPT -D__NEON_OPT" | ||
| "OTHER_CFLAGS[sdk=appletvsimulator*]": "$(inherited) -DOS_IOS" |
There was a problem hiding this comment.
Config.xcconfig sets -pthread (and other arch-level flags) in OTHER_CFLAGS[arch=*], but this XcodeGen spec never adds -pthread anywhere. That makes the XcodeGen-generated build flags materially different from the existing Xcode project and may affect compilation in code that relies on pthread-related defines.
| - "-fvisibility=hidden" | ||
| - "-fomit-frame-pointer" | ||
| - "-fvisibility-inlines-hidden" | ||
| - "-fPIC" |
There was a problem hiding this comment.
In Package.swift, the gliden_osd target adds additional C flags including -flto and -pthread, but this XcodeGen target's OTHER_CFLAGS list omits them. If the goal is to mirror the SPM build, consider bringing those flags across (or documenting why they are intentionally excluded for the XcodeGen path).
| - "-fPIC" | |
| - "-fPIC" | |
| - "-flto" | |
| - "-pthread" |
| @@ -0,0 +1,2 @@ | |||
| ### Added | |||
There was a problem hiding this comment.
This fragment describes a developer-facing build-system change. Per .changelog/README.md, these changes generally belong under ### CI / Infrastructure rather than ### Added (which is intended for user-visible features/new APIs).
| ### Added | |
| ### CI / Infrastructure |
|
✅ Fixes pushed — addressed all valid Copilot review comments on Copilot Review AuditAlready fixed in prior commits (dismissed)
Fixed in this commit
|
65685a0 to
01ac4f0
Compare
01ac4f0 to
2c933bd
Compare
0fc6860 to
c4f74c0
Compare
|
👋 Triage pass — this Please react on this comment so I know what to do:
No reaction within 7 days → I'll close as stale. Re-open any time if you change your mind. |
Rebased — still wantedThis PR adds only two new files ( What was done
The PR is ready for review. The XcodeGen
|
Add project.yml for the Mupen64Plus core package so the Xcode project can be regenerated via XcodeGen (xcodegen generate) without manually editing project.pbxproj. - Maps all SPM targets (PVMupen, PVMupenBridge, PVMupen64PlusCore, PVRSPCXD4, PVMupen64PlusRspHLE, SDL, libpng, glidenhq, gliden_osd, PVMupen64PlusVideoGlideN64, PVMupen64PlusVideoRice) to XcodeGen targets - Mirrors build settings from Config.xcconfig and Package.swift - Supports iOS and tvOS with platform-appropriate GLES defines - Both build paths (SPM and XcodeGen-generated .xcodeproj) are now supported side-by-side Part of #2856 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update SWIFT_VERSION from 5.0 to 6.0 to match Package.swift toolchain - Add packages: section for all PV* local dependencies (PVAudio, PVCoreBridge, PVCoreObjCBridge, PVEmulatorCore, PVLogging, PVObjCUtils, PVPlists, PVSupport) - Wire package products as dependencies in PVMupen and PVMupenBridge targets - Add SDK-specific GCC_PREPROCESSOR_DEFINITIONS[sdk=...] for iOS/tvOS GLES/NEON/OS_IOS/USE_GLES* defines mirroring Package.swift sharedCSettings - Replace invalid linkerFlags: keys with OTHER_LDFLAGS in settings.base for libpng, glidenhq, PVMupen64PlusVideoGlideN64, PVMupen64PlusVideoRice - Replace invalid sdk: key with OTHER_LDFLAGS for OpenGLES linkage in PVMupen64PlusVideoGlideN64 - Change libpng and glidenhq type from framework to library.static to match existing project.pbxproj artifact type - Fix changelog entry: single sentence, no trailing period Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add SDK-conditional OTHER_CFLAGS for iphoneos/simulator/appletvos/appletvsimulator to mirror Config.xcconfig -DOS_IOS/-D__VEC4_OPT/-D__NEON_OPT flags - Add EXCLUDED_SOURCE_FILE_NAMES[sdk=appletvos*] for non-NEON sources - Add EXCLUDED/INCLUDED_SOURCE_FILE_NAMES[sdk=appletvsimulator*] simulator stub - Add GCC_PREPROCESSOR_DEFINITIONS[sdk=macosx*] for macOS builds - Convert -lz OTHER_LDFLAGS to dependencies: sdk: libz.tbd (XcodeGen-idiomatic) - Convert -framework OpenGLES to dependencies: sdk: OpenGLES.framework Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove invalid 'allowedOverridesForPlatformSpecialization' XcodeGen option - Include CorePlist-Generated.swift (already committed, not build-generated) - Add SDL target dependency to PVMupen64PlusVideoRice Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add -pthread to global OTHER_CFLAGS[arch=*] matching Config.xcconfig - Add -flto and -pthread to gliden_osd target OTHER_CFLAGS (mirrors Package.swift) - Change changelog section from Added to CI / Infrastructure Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename PVMupenBridge target → PVMupen64PlusBridge to match module name expected by Swift imports and ObjC generated headers - Add PVSettings to packages section and as a dependency of both PVMupen and PVMupen64PlusBridge (sources use @import PVSettings) - Add PVLoggingObjC product dependency to PVMupen64PlusBridge (ObjC sources use @import PVLoggingObjC) - Add PRODUCT_MODULE_NAME: PVMupen64PlusBridge to bridge target settings - Add Core.plist resource to PVMupen target to prevent runtime crash - Fix tvOS simulator EXCLUDED/INCLUDED_SOURCE_FILE_NAMES to use $(inherited) — XcodeGen resolves sources explicitly so wildcard * would break the build Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ject.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ve redundant arch=* CFLAGS - Add VALIDATE_WORKSPACE_SKIPPED_SDK_FRAMEWORKS: OpenGLES to project-level settings to suppress Xcode validation warnings (mirrors hand-maintained .xcodeproj) - Remove redundant OTHER_CFLAGS[arch=*] entry; -pthread already in base OTHER_CFLAGS Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix gliden_osd header search path: rice/src → rice/rice/src - Compose OTHER_CFLAGS via M64_ARCH_CFLAGS/M64_SDK_CFLAGS helpers so both arch-tuning and SDK-specific defines are applied together (Xcode only resolves one conditionalized variant per setting) - Update misleading tvOS-simulator comment about non-existent Debug target Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Adds an XcodeGen
project.ymlfor the Mupen64Plus core package so both SPM and XcodeGen-generated Xcode build paths are supported side-by-side.What's included
Cores/Mupen64Plus/project.yml— XcodeGen spec that mirrors the existingPackage.swiftPVMupen,PVMupenBridge,PVMupen64PlusCore,PVRSPCXD4,PVMupen64PlusRspHLE,SDL,libpng,glidenhq,gliden_osd,PVMupen64PlusVideoGlideN64,PVMupen64PlusVideoRiceConfig.xcconfigandPackage.swiftmerged intoproject.ymlHow to use
SPM build (existing, unchanged):
XcodeGen build (new):
What still needs human validation
xcodegen generatelocally and confirm the project opens/builds in Xcodeincludes:filter in XcodeGen is informational — XcodeGen may not honour explicit file lists; may need to useexcludes:instead for files that shouldn't compilePVMupen64PlusVideoRicepath (Sources/Plugins/Video/rice/rice/src) is correctNotes
project.pbxproj— this PR is additive onlyPVMupen64PlusVideoRiceandPVMupen64PlusRspHLEtargets are defined inproject.ymlbut are currently commented out inPackage.swift(disabled in the main product) — they're preserved here for future usePart of #2856
Test plan
cd Cores/Mupen64Plus && xcodegen generate— no errors.xcodeprojopens in Xcode 16+ without errorsswift buildstill works (SPM path unchanged)🤖 Generated with Claude Code