Generated xcodeproj for C language target

I have an issue when generating an xcodeproj with SwiftPM, which sounded like it was solved by SwiftPM 4.2.0:

It sounded like it was solving my issue, but it doesn't seem to change anything w.r.t. DEFINES_MODULE when running swift package generate-xcodeproj (I installed Swift 4.2 and xcode-selected Xcode 10 beta, `swift package --version says "Swift 4.2.0 (swiftpm-14248)").

I am looking into the open source project grpc-swift, so I can be very specific: the target CgRPC doesn't build properly (i.e. CgRPC.framework doesn't contain "Headers" and "Modules"). When manually setting DEFINES_MODULE to "Yes", and adding a Header build phase, the CgRPC target results in a correct framework.

Looking at the target, one can see that the include/ directory contains a header called .h (i.e. grpc.h).

Shouldn't it be detected as an umbrella header, hence fixing the build and enabling DEFINES_MODULE?

There are two problems with that target that prevents creating a proper framework:

  • It already contains a modulemap file.
  • The umbrella header contains a non-modular include i.e. it escapes the include directory.

Right. So if I remove the modulemap file, I end up on this error.

Which means that now it tries to generate a modulemap :-). Interestingly, I get the same output with 4.1.0 (even though I thought it was new in 4.2.0).

Anyway, I have no clue how to fix the includes, and I don't really know umbrella headers. I'll try to learn about that.

Thanks for the answer!