Issue with importing Obj-C module in Obj-C target

Hey folks,

I was playing around with Swift Package Manager with Objective-C targets and ran across what I believe is a bug (or maybe I'm doing something incorrectly).

I created a simple repro project on GitHub to demonstrate this that will be easier to follow along, but I'll describe the issue here as well.

With two C based targets where one has a dependency on the other, I would expect to be able to use @import <ModuleNameFromTarget>; to import the generated module in the C (Objective-C in this case) code. I'm able to successfully import modules from both targets in a Swift based target, but not in a C based target. The only way to successfully import headers from the other target is to use the header name directly as a file import.

There are two errors that occur: running swift build or swift run will result in a fatal error: module 'Foo' not found. If you generate an Xcode project, C based modules are disabled in the generated project so it fails right away.

Is this expected behaviour, or is this a bug? If it's a bug I'm happy to report it to the bug reporter but thought I'd check in to see if my assumptions were wrong first.

Thanks,
Ryan

2 Likes

Definitely sounds like a bug. Can you please file a JIRA?

Absolutely, thanks for the fast reply!

1 Like

Done! SR-10707

1 Like

Thanks!

Is there any temporary workaround for this?