Packaging static library in SPM Package for iOS Executable

Xcode also puts a static library (.o with .swiftmodule) into $(BUILT_PRODUCTS_DIR)/Frameworks/ for every dynamic Swift Package. How can we delete these with a script? Would that go in to a script phase of the build?

Also, how can we avoid from Xcode putting the dynamic framework products of Swift Packages into $(BUILT_PRODUCTS_DIR)/Frameworks/PackageFrameworks/? It's really causing problems for it to use a subdirectory like that.

Why can't they just treat building a Swift Packages the same exact way as building an .xcproj? They should behave identically but they don't.

1 Like

I'm seeing an issue with a similar configuration in swift 5.7. I've set up my package very much like this, but the wrapper target cannot reference any type defined in the static lib's headers ---> "Cannot find type 'abc' in scope".