- Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Description
Even with .interoperabilityMode(.Cxx)
enabled, it still can't find the <swift/bridging> header for a hpp file on Linux SDK.
The current workaround is adding the SDK search path manually.
eg.
.unsafeFlags(["-I", "/home/kyle/.swiftbox/toolchain/swift-6.1.2/usr/include/"])
It works for simple demo package but would introduce other header issue on a large project.
Reproduction
. ├── Package.swift └── Sources ├── AKit │ ├── A.cpp │ └── include │ └── A.hpp └── BKit └── main.swift
// A.hpp #include <swift/bridging>
Package.swift:
// swift-tools-version: 6.1 import PackageDescription let package = Package( name: "DemoKit", products: [ .executable(name: "BKit", targets: ["BKit"]) ], targets: [ .target( name: "AKit", ), .executableTarget( name: "BKit", dependencies: ["AKit"], swiftSettings: [ .interoperabilityMode(.Cxx), // .unsafeFlags(["-I", "/home/kyle/.swiftbox/toolchain/swift-6.1.2/usr/include/"]), ] ), ] )
Full reproduce package code can be found here.
DemoKit.zip
Expected behavior
Build successfully like macOS platform
Environment
swiftc --version
Swift version 6.1 (swift-6.1-RELEASE)
Target: aarch64-unknown-linux-gnu