-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPackage.swift
43 lines (39 loc) · 1.53 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// swift-tools-version:5.3
import PackageDescription
import Foundation
guard let sdkRoot = ProcessInfo.processInfo.environment["SDKROOT"] else {
fatalError("Could not find SDKROOT")
}
guard let cPath = ProcessInfo.processInfo.environment["CPATH"] else {
fatalError("Could not find CPATH")
}
let package = Package(
name: "cxx-interop-test",
platforms: [.macOS(.v10_15)],
products: [
.executable(
name: "cxx-interop-test",
targets: ["cxx-interop-test"]),
],
dependencies: [
],
targets: [
.target(name: "CXX", dependencies: []),
.target(
name: "cxx-interop-test",
dependencies: ["CXX"],
path: "./Sources/Swift",
sources: [ "main.swift" ],
swiftSettings: [.unsafeFlags([
// TODO: we shouldn't have to do this. See SRXXXX.
"-Xfrontend", "-validate-tbd-against-ir=none",
"-Xfrontend", "-enable-cxx-interop",
"-I", "Sources/CXX/include",
"-I", "\(sdkRoot)/usr/include",
"-I", "\(cPath)",
"-lc++",
"-Xfrontend", "-disable-implicit-concurrency-module-import",
"-Xcc", "-nostdinc++"])]),
],
cxxLanguageStandard: CXXLanguageStandard.cxx14
)