[swift-evolution] [swift-build-dev] [swiftpm] Add proposal for C language support

Maury Markowitz maury.markowitz at gmail.com
Sun Jan 3 08:34:19 CST 2016

> On Jan 2, 2016, at 9:00 AM, Daniel Dunbar via swift-build-dev <swift-build-dev at swift.org> wrote:
> Happy 2016!
> I am working on an initial proposal for adding support for C language targets to the Swift package manager, and am interested in feedback:

The idea of including C libraries/code in Swift projects *without* having to use Xcode strikes me as *very* valuable. Two questions:

a) for item (2) in "solution" I see the advantages of placing the bridging in a separate directory, but I want to point out that this may make the interactions between various devenvs and things like GitHub more annoying. Xcode's Bridging-Header solution has it's own problems, but may be easier to work with in complex projects. Generally I think more flexibility here might be valuable, even going so far as a ".bh" for the bridging files, allowing them to be placed anywhere.

b) for (3), I'm facing this problem right now porting some very old C that has a main.c that includes main() as well as other more general code that the rest of the system uses. I solved this by changing main(), but that's not ideal, I would greatly prefer to use the original code verbatim. So for the 10% of cases where this is a problem, perhaps a compiler directive would be useful?

More information about the swift-evolution mailing list