Skip to content

Conversation

@nmcc24
Copy link

@nmcc24 nmcc24 commented Nov 25, 2025

Resolves #1015

Short description 📝

Currently, XcodeProj is not compilable on iOS platform. This is an issue when attempting to compile products that have XcodeProj as a (transitive) dependency

Solution 📦

Add appropriate iOS compiler flag and version check to ensure symbols are available and guarantee successful compilation.

Implementation 👩‍💻👨‍💻

Detail in a checklist the steps that you took to implement the PR.

  • Add compiler flags
  • Add iOS version checks
  • Build XcodeProj target
  • Compile XcodeProj tests
Currently, XcodeProj is not compilable on iOS platform. This is an issue when attempting to compile products that have XcodeProj as a (transitive) dependency
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 25, 2025
@nmcc24
Copy link
Author

nmcc24 commented Dec 1, 2025

@fortmarek @cschmatzler @asmitbm could you please take a look at this and let me know your thoughts? Thanks a lot

@pepicrft
Copy link
Contributor

pepicrft commented Dec 5, 2025

@nmcc24 this package was not designed for running on non-macOS platforms, so even if you make it compile, some features might not work. I'd suggest to use conditional linking when declaring a dependency on this package to specify that it should only link it when building against the macOS platform.

@nmcc24
Copy link
Author

nmcc24 commented Dec 12, 2025

Hi @pepicrft thanks for your comment.

I completely understand and appreciate it, and in all honesty I don't think it would make any sense to run the targets on iOS.

However, it is impossible to restrict a swift package from being compiled on iOS ( if we don't declare the platform, it will fallback to a minimum version).

Having said that, and in the context of my problem where this transitive dependency is not allowing the compilation of a build plugin that will run at compile time of a product targeting the iOS platform, this suggested approach would solve this problem without bringing any side effect that doesn't already exist on any swift package.

I'm of course open to any other approaches that come to mind :)

@pepicrft
Copy link
Contributor

@nmcc24 thanks a lot for the context, I appreciate it.

Wouldn't TargetDependencyCondition be useful in this case, where you can declare a dependency conditionally based on the platform:

Target(name: "MyTarget", dependencies: [ .product(name: "XcodeProj, condition: .when([.macOS])) ]) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

2 participants