- Proposal: SE-NNNN
- Author: Harlan Haskins
- Review Manager: TBD
- Status: Awaiting Review
- Decision Notes: Rationale
- Pull Request: apple/swift-package-manager#257
Swift Package Manager is currently able to compile C and Objective-C source files as targets. We wish to extend this to C++ source files, allowing developers to interface with existing C++ libraries and expose C APIs that can be consumed in Swift.
It's common for developers to mix C and C++ in projects, especially if they use a system C++ library. Unfortunately, SwiftPM cannot facilitate these kinds of projects, because it is not able to differentiate C++ and C files within the same target.
Teach SwiftPM how to compile C++ and Objective-C++ files, and provide a -Xcxx
flag to pass arguments to clang++
.
This proposal is additive, so it will not affect existing C or Objective-C targets.