You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to have a project with mixed ObjC-Swift modules, using static frameworks.
I created a project.yml that describes:
An app target with dependency on ModuleA and ModuleB
ModuleA static framework with both Swift and ObjC code, with a dependency on ModuleB
ModuleB static framework with both Swift and ObjC code
However, it seems like ModuleA and ModuleB are being treated as libraries with respect to some regards, with for example the generated interface <module-name>-Swift.h not being copied to the expected Products path (<ModuleName>.framework/Headers), and instead being copied to DerivedSource (just like it happens with static libraries) and so Xcode fails to find it with this error:
When taking a look at the build log, it becomes clear that the generated interface is being created, but being copied to DerivedSources instead of the expected <ModuleName>.framework/Headers:
If I remove the target generated by XcodeGen and create it from scratch using Xcode (as a dynamic framework but then manually change Mach-O type to static, specify modulemap, and then change embed to Do Not Embed in the app target), then everything works fine, and the copy path for the generated interface is the right one:
Also for some reason the icon shown in the build log is different. With the Xcode-created target, the icon is the framework one 🧳 (the suitcase), but with XcodeGen the icon is the target one 🎯 (not sure if this actually means anything...)
Also, when navigating to the Products folder, I noticed that the <ModuleName>.swiftmodule for the Xcode-created target is generated within the framework, however with the XcodeGen one, it's created outside of it:
I hit this same issue, and ended up working around it by using the framework product type and setting the MACH_O_TYPE build setting to staticlib manually.
@jschear Thanks for the tip! What about linking? I think the app target should not embed the static frameworks. I think we also have to change that manually within Xcode
That's my understanding too (that frameworks containing static libraries should not be embedded in app bundles). I believe this recent PR made that XcodeGen's default behavior: #1003
I'm trying to have a project with mixed ObjC-Swift modules, using static frameworks.
I created a
project.yml
that describes:ModuleA
andModuleB
ModuleA
static framework with both Swift and ObjC code, with a dependency onModuleB
ModuleB
static framework with both Swift and ObjC codeHowever, it seems like
![Screen Shot 2021-02-24 at 10 26 56](https://user-images.githubusercontent.com/3900360/108984799-9c9f8400-7690-11eb-9cc3-fc8424b6cbdd.png)
ModuleA
andModuleB
are being treated as libraries with respect to some regards, with for example the generated interface<module-name>-Swift.h
not being copied to the expected Products path (<ModuleName>.framework/Headers
), and instead being copied to DerivedSource (just like it happens with static libraries) and so Xcode fails to find it with this error:When taking a look at the build log, it becomes clear that the generated interface is being created, but being copied to DerivedSources instead of the expected
![Screen Shot 2021-02-24 at 10 39 39](https://user-images.githubusercontent.com/3900360/108985003-d40e3080-7690-11eb-9852-d6ce6af6eaf4.png)
<ModuleName>.framework/Headers
:If I remove the target generated by XcodeGen and create it from scratch using Xcode (as a dynamic framework but then manually change Mach-O type to static, specify modulemap, and then change embed to
![Screen Shot 2021-02-24 at 10 43 30](https://user-images.githubusercontent.com/3900360/108985374-44b54d00-7691-11eb-99b3-08517170a497.png)
Do Not Embed
in the app target), then everything works fine, and the copy path for the generated interface is the right one:Also for some reason the icon shown in the build log is different. With the Xcode-created target, the icon is the framework one 🧳 (the suitcase), but with XcodeGen the icon is the target one 🎯 (not sure if this actually means anything...)
Also, when navigating to the Products folder, I noticed that the
<ModuleName>.swiftmodule
for the Xcode-created target is generated within the framework, however with the XcodeGen one, it's created outside of it:Xcode-created target:
![Screen Shot 2021-02-24 at 11 21 19](https://user-images.githubusercontent.com/3900360/108986461-6f53d580-7692-11eb-9690-b4244a8ea9c5.png)
XcodeGen-created target:
![Screen Shot 2021-02-24 at 11 21 50](https://user-images.githubusercontent.com/3900360/108986513-7e3a8800-7692-11eb-9ef6-2d9c674450e5.png)
Here's how the
project.yml
looks like:And this is the attached sample project:
XcodegenTest.zip
The text was updated successfully, but these errors were encountered: