@@ -49,6 +49,11 @@ var singleSourceLibraries: [String] = singleSourceLibraryDirs.flatMap {
4949 getSingleSourceLibraries ( subDirectory: $0)
5050}
5151
52+ var cxxSingleSourceLibraryDirs : [ String ] = [ " cxx-source " ]
53+ var cxxSingleSourceLibraries : [ String ] = cxxSingleSourceLibraryDirs. flatMap {
54+ getSingleSourceLibraries ( subDirectory: $0)
55+ }
56+
5257//===---
5358// Multi Source Libraries
5459//
@@ -80,6 +85,7 @@ products.append(.library(name: "ObjectiveCTests", type: .static, targets: ["Obje
8085products. append ( . executable( name: " SwiftBench " , targets: [ " SwiftBench " ] ) )
8186
8287products += singleSourceLibraries. map { . library( name: $0, type: . static, targets: [ $0] ) }
88+ products += cxxSingleSourceLibraries. map { . library( name: $0, type: . static, targets: [ $0] ) }
8389products += multiSourceLibraries. map {
8490 return . library( name: $0. name, type: . static, targets: [ $0. name] )
8591}
@@ -103,13 +109,18 @@ swiftBenchDeps.append(.target(name: "ObjectiveCTests"))
103109#endif
104110swiftBenchDeps. append ( . target( name: " DriverUtils " ) )
105111swiftBenchDeps += singleSourceLibraries. map { . target( name: $0) }
112+ swiftBenchDeps += cxxSingleSourceLibraries. map { . target( name: $0) }
106113swiftBenchDeps += multiSourceLibraries. map { . target( name: $0. name) }
107114
108115targets. append (
109116 . target( name: " SwiftBench " ,
110117 dependencies: swiftBenchDeps,
111118 path: " utils " ,
112- sources: [ " main.swift " ] ) )
119+ sources: [ " main.swift " ] ,
120+ swiftSettings: [ . unsafeFlags( [ " -Xfrontend " ,
121+ " -enable-cxx-interop " ,
122+ " -I " ,
123+ " utils/CxxTests " ] ) ] ) )
113124
114125#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
115126targets. append (
@@ -139,6 +150,18 @@ targets += singleSourceLibraries.map { name in
139150 sources: [ " \( name) .swift " ] )
140151}
141152
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+
142165targets += multiSourceLibraries. map { lib in
143166 return . target(
144167 name: lib. name,
0 commit comments