I need to construct a swift package deal which additionally makes use of code from c++ , so the issue I’m going through is I can construct and use one single c++ file , however after I add a number of c++ file it reveals file not discovered. Because the screenshot describes this extra.
My swift package deal file –
// swift-tools-version: 5.10
import PackageDescription
let package deal = Bundle(
title: "AVTPG_Module",
merchandise: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "AVTPG_Module",
targets: ["AVTPG_Module"]
),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
.target(
name: "CppModule",
path: "Sources/CppModule",
cxxSettings: [
.headerSearchPath("include")
]
), // <- Add a comma right here
.goal(
title: "AVTPG_Module",
dependencies: ["CppModule"],
swiftSettings: [.interoperabilityMode(.Cxx)]
),
.testTarget(
title: "AVTPG_ModuleTests",
dependencies: ["AVTPG_Module"]
),
]
)
I need to use a number of c++ file in my swift package deal.