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 have an issue with Swift PM and generated Xcode project. Here's a summary of the project setup
I have a framework project defined and generated with Swift PM Package.swift
In that Package.swift, it has a few dependencies which are Swift library and Clang library. In this case is the Swift gRPC project which include CgRPC as a dependency
I generated the Xcode project file with that `swift package-manager --generate-xcodeproj` command and add that project into my main app Xcode project
I added the built framework as an dependency and try to build it
The result is a build failed with `missing module CgRPC` error.
I try to investigate on this and found that
CgRPC has a module.modulemap file in its `include` folder with its umbrella header along with some header files in a few folders
Since it has a few folders in the include folder, it can't be able to rely on Swift PM module map generation code due to that Swift PM has a flat header folder requirement
SwiftPM will use the defined `module.modulemap` file if it existed (which is in this case)
I tried to modify the generated Xcode project file by enable that CgRPC target as a module and add its umbrella header to the Add Header build phase and it works. The app target can be built successfully and the auto complete in both the source editor and debugging console works
So my question is that, is this an intended behavior? Should we change the behavior of the built-in module map case to be the same as the built-in umbrella header case?
The text was updated successfully, but these errors were encountered:
Environment
Swift 4.2.1 Xcode 10.1
Additional Detail from JIRA
md5: 82e8a19f301b596ce1e99c01395f5096
Issue Description:
I have an issue with Swift PM and generated Xcode project. Here's a summary of the project setup
I have a framework project defined and generated with Swift PM Package.swift
In that Package.swift, it has a few dependencies which are Swift library and Clang library. In this case is the Swift gRPC project which include CgRPC as a dependency
I generated the Xcode project file with that `swift package-manager --generate-xcodeproj` command and add that project into my main app Xcode project
I added the built framework as an dependency and try to build it
The result is a build failed with `missing module CgRPC` error.
I try to investigate on this and found that
CgRPC has a module.modulemap file in its `include` folder with its umbrella header along with some header files in a few folders
Since it has a few folders in the include folder, it can't be able to rely on Swift PM module map generation code due to that Swift PM has a flat header folder requirement
SwiftPM will use the defined `module.modulemap` file if it existed (which is in this case)
However the default behavior is that Swift PM won't enable module for Clang target even there is a built in module.modulemap file. It will enable for only the case that it can't find built in module map but it can find an umbrella header. https://github.com/apple/swift-package-manager/blame/master/Sources/Xcodeproj/pbxproj().swift#L583
I tried to modify the generated Xcode project file by enable that CgRPC target as a module and add its umbrella header to the Add Header build phase and it works. The app target can be built successfully and the auto complete in both the source editor and debugging console works
So my question is that, is this an intended behavior? Should we change the behavior of the built-in module map case to be the same as the built-in umbrella header case?
The text was updated successfully, but these errors were encountered: