@@ -1366,7 +1366,9 @@ final class BuildPlanTests: XCTestCase {
1366
1366
Pkg . appending ( components: " Sources " , " exe " , " main.cpp " ) . pathString,
1367
1367
Pkg . appending ( components: " Sources " , " lib " , " lib.c " ) . pathString,
1368
1368
Pkg . appending ( components: " Sources " , " lib " , " libx.cpp " ) . pathString,
1369
- Pkg . appending ( components: " Sources " , " lib " , " include " , " lib.h " ) . pathString
1369
+ Pkg . appending ( components: " Sources " , " lib " , " include " , " lib.h " ) . pathString,
1370
+ Pkg . appending ( components: " Sources " , " swiftInteropLib " , " lib.swift " ) . pathString,
1371
+ Pkg . appending ( components: " Sources " , " swiftLib " , " lib.swift " ) . pathString
1370
1372
)
1371
1373
1372
1374
let observability = ObservabilitySystem . makeForTesting ( )
@@ -1381,6 +1383,9 @@ final class BuildPlanTests: XCTestCase {
1381
1383
targets: [
1382
1384
TargetDescription ( name: " exe " , dependencies: [ " lib " ] ) ,
1383
1385
TargetDescription ( name: " lib " , dependencies: [ ] ) ,
1386
+ TargetDescription ( name: " swiftInteropLib " , dependencies: [ ] ,
1387
+ settings: [ . init( tool: . swift, kind: . interoperabilityMode( . Cxx) ) ] ) ,
1388
+ TargetDescription ( name: " swiftLib " , dependencies: [ ] )
1384
1389
] ) ,
1385
1390
] ,
1386
1391
observabilityScope: observability. topScope
@@ -1396,7 +1401,7 @@ final class BuildPlanTests: XCTestCase {
1396
1401
let result = try BuildPlanResult ( plan: plan)
1397
1402
1398
1403
result. checkProductsCount ( 1 )
1399
- result. checkTargetsCount ( 2 )
1404
+ result. checkTargetsCount ( 4 )
1400
1405
1401
1406
let buildPath : AbsolutePath = result. plan. buildParameters. dataPath. appending ( components: " debug " )
1402
1407
@@ -1446,6 +1451,11 @@ final class BuildPlanTests: XCTestCase {
1446
1451
let contents : String = try fs. readFileContents ( yaml)
1447
1452
XCTAssertMatch ( contents, . contains( #"-std=gnu99","-c"," \#( Pkg . appending ( components: " Sources " , " lib " , " lib.c " ) . escapedPathString ( ) ) "# ) )
1448
1453
XCTAssertMatch ( contents, . contains( #"-std=c++1z","-c"," \#( Pkg . appending ( components: " Sources " , " lib " , " libx.cpp " ) . escapedPathString ( ) ) "# ) )
1454
+
1455
+ let swiftInteropLib = try result. target ( for: " swiftInteropLib " ) . swiftTarget ( ) . compileArguments ( )
1456
+ XCTAssertMatch ( swiftInteropLib, [ . anySequence, " -cxx-interoperability-mode=default " , " -Xcc " , " -std=c++1z " , . end] )
1457
+ let swiftLib = try result. target ( for: " swiftLib " ) . swiftTarget ( ) . compileArguments ( )
1458
+ XCTAssertNoMatch ( swiftLib, [ . anySequence, " -Xcc " , " -std=c++1z " , . anySequence] )
1449
1459
}
1450
1460
1451
1461
func testSwiftCMixed( ) throws {
0 commit comments