Open litewrap opened 9 months ago
Correct, the compatibility header is only generated on Darwin platforms, see https://github.com/apple/swift-package-manager/blob/main/Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift#L693
I find a workaround by passing the following unsafe flag: -emit-clang-header-path
.target(
name: "TestCxxToSwift",
swiftSettings: [.interoperabilityMode(.Cxx), .unsafeFlags(["-emit-clang-header-path", "MySwiftModule-Swift.h"])]
),
I hope a fix for SwiftPM with Cxx interop will behave the same on all platforms.
Description
Very basic Swift library build with .interoperabilityMode(.Cxx) Build success on macOS and C++ header generated. Build success on Windows but C++ header not generated.
Expected behavior
C++ header generated.
Actual behavior
C++ header not generated.
Steps to reproduce
Swift Package Manager version/commit hash
Building on Windows using DEVELOPMENT-SNAPSHOT-2024-01-30.
Swift & OS version (output of
swift --version ; uname -a
)C:\Users\admin\Documents\atwork\SwiftProjects\TestCxxToSwift>swift --version Swift version 5.11-dev (LLVM 0c7051c13ba8526, Swift 192d275b78109ff) Target: x86_64-unknown-windows-msvc