@@ -49,6 +49,11 @@ var singleSourceLibraries: [String] = singleSourceLibraryDirs.flatMap {
49
49
getSingleSourceLibraries ( subDirectory: $0)
50
50
}
51
51
52
+ var cxxSingleSourceLibraryDirs : [ String ] = [ " cxx-source " ]
53
+ var cxxSingleSourceLibraries : [ String ] = cxxSingleSourceLibraryDirs. flatMap {
54
+ getSingleSourceLibraries ( subDirectory: $0)
55
+ }
56
+
52
57
//===---
53
58
// Multi Source Libraries
54
59
//
@@ -80,6 +85,7 @@ products.append(.library(name: "ObjectiveCTests", type: .static, targets: ["Obje
80
85
products. append ( . executable( name: " SwiftBench " , targets: [ " SwiftBench " ] ) )
81
86
82
87
products += singleSourceLibraries. map { . library( name: $0, type: . static, targets: [ $0] ) }
88
+ products += cxxSingleSourceLibraries. map { . library( name: $0, type: . static, targets: [ $0] ) }
83
89
products += multiSourceLibraries. map {
84
90
return . library( name: $0. name, type: . static, targets: [ $0. name] )
85
91
}
@@ -103,13 +109,18 @@ swiftBenchDeps.append(.target(name: "ObjectiveCTests"))
103
109
#endif
104
110
swiftBenchDeps. append ( . target( name: " DriverUtils " ) )
105
111
swiftBenchDeps += singleSourceLibraries. map { . target( name: $0) }
112
+ swiftBenchDeps += cxxSingleSourceLibraries. map { . target( name: $0) }
106
113
swiftBenchDeps += multiSourceLibraries. map { . target( name: $0. name) }
107
114
108
115
targets. append (
109
116
. target( name: " SwiftBench " ,
110
117
dependencies: swiftBenchDeps,
111
118
path: " utils " ,
112
- sources: [ " main.swift " ] ) )
119
+ sources: [ " main.swift " ] ,
120
+ swiftSettings: [ . unsafeFlags( [ " -Xfrontend " ,
121
+ " -enable-cxx-interop " ,
122
+ " -I " ,
123
+ " utils/CxxTests " ] ) ] ) )
113
124
114
125
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
115
126
targets. append (
@@ -139,6 +150,18 @@ targets += singleSourceLibraries.map { name in
139
150
sources: [ " \( name) .swift " ] )
140
151
}
141
152
153
+ targets += cxxSingleSourceLibraries. map { name in
154
+ return . target(
155
+ name: name,
156
+ dependencies: singleSourceDeps,
157
+ path: " cxx-source " ,
158
+ sources: [ " \( name) .swift " ] ,
159
+ swiftSettings: [ . unsafeFlags( [ " -Xfrontend " ,
160
+ " -enable-cxx-interop " ,
161
+ " -I " ,
162
+ " utils/CxxTests " ] ) ] )
163
+ }
164
+
142
165
targets += multiSourceLibraries. map { lib in
143
166
return . target(
144
167
name: lib. name,
0 commit comments