Experimenting basic C++ to Swift interop on Windows.
// swift-tools-version: 5.11
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "TestCxxToSwift",
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "TestCxxToSwift",
type: .dynamic,
targets: ["TestCxxToSwift"]),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "TestCxxToSwift",
swiftSettings: [.interoperabilityMode(.Cxx)]
),
.testTarget(
name: "TestCxxToSwiftTests",
dependencies: ["TestCxxToSwift"],
swiftSettings: [.interoperabilityMode(.Cxx)]
)
]
)
Building on Windows using DEVELOPMENT-SNAPSHOT-2024-01-30.
Build success but the C++ header is not generated.
Note: The same Package built on macOS generate the C++ header.
How to generate C++ header on Windows ?