@@ -1122,7 +1122,7 @@ final class BuildPlanTests: XCTestCase {
1122
1122
#endif
1123
1123
XCTAssertEqual ( try ext. basicArguments ( isCXX: false ) , args)
1124
1124
XCTAssertEqual ( try ext. objects, [ buildPath. appending ( components: " extlib.build " , " extlib.c.o " ) ] )
1125
- XCTAssertEqual ( ext. moduleMap, buildPath. appending ( components: " extlib.build " , " module.modulemap " ) )
1125
+ XCTAssertEqual ( ext. moduleMap, buildPath. appending ( components: " extlib.build " , " Product " , " module.modulemap " ) )
1126
1126
1127
1127
let exe = try result. target ( for: " exe " ) . clangTarget ( )
1128
1128
args = [ ]
@@ -1145,9 +1145,9 @@ final class BuildPlanTests: XCTestCase {
1145
1145
args += [
1146
1146
" -I " , Pkg . appending ( components: " Sources " , " exe " , " include " ) . pathString,
1147
1147
" -I " , Pkg . appending ( components: " Sources " , " lib " , " include " ) . pathString,
1148
- " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " module.modulemap " ) ) " ,
1148
+ " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) ) " ,
1149
1149
" -I " , ExtPkg . appending ( components: " Sources " , " extlib " , " include " ) . pathString,
1150
- " -fmodule-map-file= \( buildPath. appending ( components: " extlib.build " , " module.modulemap " ) ) " ,
1150
+ " -fmodule-map-file= \( buildPath. appending ( components: " extlib.build " , " Product " , " module.modulemap " ) ) " ,
1151
1151
]
1152
1152
#if !os(Windows) // FIXME(5473) - modules flags on Windows dropped
1153
1153
args += [ " -fmodules-cache-path= \( buildPath. appending ( components: " ModuleCache " ) ) " ]
@@ -1436,8 +1436,9 @@ final class BuildPlanTests: XCTestCase {
1436
1436
" -target " , " \( defaultTargetTriple) " , " -swift-version " , " 4 " ,
1437
1437
" -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " , . equal( j) ,
1438
1438
" -DSWIFT_PACKAGE " , " -DDEBUG " , " -Xcc " ,
1439
- " -fmodule-map-file=/path/to/build/debug/lib.build/module.modulemap " ,
1440
- " -Xcc " , " -I " , " -Xcc " , " /Pkg/Sources/lib/include " ,
1439
+ " -fmodule-map-file=/path/to/build/debug/lib.build/Product/module.modulemap " ,
1440
+ " -Xcc " , " -ivfsoverlay " , " -Xcc " ,
1441
+ " /path/to/build/debug/lib.build/all-product-headers.yaml " ,
1441
1442
" -module-cache-path " ,
1442
1443
" \( buildPath. appending ( components: " ModuleCache " ) ) " , . anySequence
1443
1444
] )
@@ -1446,8 +1447,9 @@ final class BuildPlanTests: XCTestCase {
1446
1447
XCTAssertMatch ( swiftPartOfLib, [
1447
1448
" -target " , " \( defaultTargetTriple) " , " -swift-version " , " 4 " ,
1448
1449
" -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " , . equal( j) ,
1449
- " -DSWIFT_PACKAGE " , " -DDEBUG " , " -import-underlying-module " , " -Xcc " ,
1450
- " -ivfsoverlay " , " -Xcc " , " /path/to/build/debug/lib.build/all-product-headers.yaml " ,
1450
+ " -DSWIFT_PACKAGE " , " -DDEBUG " , " -import-underlying-module " , " -I " ,
1451
+ " /path/to/build/debug/lib.build/Product " , " -Xcc " , " -ivfsoverlay " ,
1452
+ " -Xcc " , " /path/to/build/debug/lib.build/all-product-headers.yaml " ,
1451
1453
" -Xcc " , " -ivfsoverlay " , " -Xcc " ,
1452
1454
" /path/to/build/debug/lib.build/unextended-module-overlay.yaml " ,
1453
1455
" -module-cache-path " ,
@@ -1460,8 +1462,8 @@ final class BuildPlanTests: XCTestCase {
1460
1462
XCTAssertMatch ( clangPartOfLib, [
1461
1463
" -fobjc-arc " , " -target " , " x86_64-apple-macosx10.13 " , " -g " , " -O0 " ,
1462
1464
" -DSWIFT_PACKAGE=1 " , " -DDEBUG=1 " , " -fblocks " , " -fmodules " ,
1463
- " -fmodule-name=lib " , " -I " , " /Pkg/Sources/ lib/include " ,
1464
- " -I /path/to/build/debug/lib.build " ,
1465
+ " -fmodule-name=lib " , " -I " , " /path/to/build/debug/ lib.build/Product " ,
1466
+ " -ivfsoverlay " , " /path/to/build/debug/lib.build/all-product-headers.yaml " ,
1465
1467
" -fmodules-cache-path=/path/to/build/debug/ModuleCache "
1466
1468
] )
1467
1469
@@ -1475,7 +1477,7 @@ final class BuildPlanTests: XCTestCase {
1475
1477
1476
1478
XCTAssertEqual (
1477
1479
try result. target ( for: " lib " ) . mixedTarget ( ) . moduleMap? . pathString,
1478
- buildPath. appending ( components: " lib.build " , " module.modulemap " ) . pathString
1480
+ buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) . pathString
1479
1481
)
1480
1482
1481
1483
XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
@@ -1555,10 +1557,10 @@ final class BuildPlanTests: XCTestCase {
1555
1557
#endif
1556
1558
XCTAssertEqual ( try lib. basicArguments ( isCXX: false ) , args)
1557
1559
XCTAssertEqual ( try lib. objects, [ buildPath. appending ( components: " lib.build " , " lib.c.o " ) ] )
1558
- XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " module.modulemap " ) )
1560
+ XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) )
1559
1561
1560
1562
let exe = try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( )
1561
- XCTAssertMatch ( exe, [ . anySequence, " -swift-version " , " 4 " , " -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " -Xcc " , " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " module.modulemap " ) ) " , " -Xcc " , " -I " , " -Xcc " , " \( Pkg . appending ( components: " Sources " , " lib " , " include " ) ) " , " -module-cache-path " , " \( buildPath. appending ( components: " ModuleCache " ) ) " , . anySequence] )
1563
+ XCTAssertMatch ( exe, [ . anySequence, " -swift-version " , " 4 " , " -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " -Xcc " , " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) ) " , " -Xcc " , " -I " , " -Xcc " , " \( Pkg . appending ( components: " Sources " , " lib " , " include " ) ) " , " -module-cache-path " , " \( buildPath. appending ( components: " ModuleCache " ) ) " , . anySequence] )
1562
1564
1563
1565
#if os(macOS)
1564
1566
XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
@@ -1691,7 +1693,7 @@ final class BuildPlanTests: XCTestCase {
1691
1693
1692
1694
let buildPath : AbsolutePath = plan. buildParameters. dataPath. appending ( components: " debug " )
1693
1695
1694
- XCTAssertEqual ( try plan. createREPLArguments ( ) . sorted ( ) , [ " -I \( Dep . appending ( components: " Sources " , " CDep " , " include " ) ) " , " -I \( buildPath) " , " -I \( buildPath. appending ( components: " lib.build " ) ) " , " -L \( buildPath) " , " -lpkg__REPL " , " repl " ] )
1696
+ XCTAssertEqual ( try plan. createREPLArguments ( ) . sorted ( ) , [ " -I \( Dep . appending ( components: " Sources " , " CDep " , " include " ) ) " , " -I \( buildPath) " , " -I \( buildPath. appending ( components: " lib.build " , " Product " ) ) " , " -L \( buildPath) " , " -lpkg__REPL " , " repl " ] )
1695
1697
1696
1698
XCTAssertEqual ( plan. graph. allProducts. map ( { $0. name } ) . sorted ( ) , [
1697
1699
" Dep " ,
@@ -2519,7 +2521,7 @@ final class BuildPlanTests: XCTestCase {
2519
2521
XCTAssertEqual ( try lib. basicArguments ( isCXX: true ) , expectedLibBasicArgs)
2520
2522
2521
2523
XCTAssertEqual ( try lib. objects, [ buildPath. appending ( components: " lib.build " , " lib.cpp.o " ) ] )
2522
- XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " module.modulemap " ) )
2524
+ XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) )
2523
2525
2524
2526
#if os(macOS)
2525
2527
XCTAssertEqual ( try result. buildProduct ( for: " lib " ) . linkArguments ( ) , [
@@ -2958,10 +2960,10 @@ final class BuildPlanTests: XCTestCase {
2958
2960
]
2959
2961
XCTAssertEqual ( try lib. basicArguments ( isCXX: false ) , args)
2960
2962
XCTAssertEqual ( try lib. objects, [ buildPath. appending ( components: " lib.build " , " lib.c.o " ) ] )
2961
- XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " module.modulemap " ) )
2963
+ XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) )
2962
2964
2963
2965
let exe = try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( )
2964
- XCTAssertMatch ( exe, [ " -swift-version " , " 4 " , " -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " -Xcc " , " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " module.modulemap " ) ) " , " -Xcc " , " -I " , " -Xcc " , " \( Pkg . appending ( components: " Sources " , " lib " , " include " ) ) " , " -module-cache-path " , " \( buildPath. appending ( components: " ModuleCache " ) ) " , . anySequence] )
2966
+ XCTAssertMatch ( exe, [ " -swift-version " , " 4 " , " -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " , . equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " -Xcc " , " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) ) " , " -Xcc " , " -I " , " -Xcc " , " \( Pkg . appending ( components: " Sources " , " lib " , " include " ) ) " , " -module-cache-path " , " \( buildPath. appending ( components: " ModuleCache " ) ) " , . anySequence] )
2965
2967
2966
2968
XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
2967
2969
result. plan. buildParameters. toolchain. swiftCompilerPath. pathString,
@@ -3027,15 +3029,15 @@ final class BuildPlanTests: XCTestCase {
3027
3029
]
3028
3030
XCTAssertEqual ( try lib. basicArguments ( isCXX: false ) , args)
3029
3031
XCTAssertEqual ( try lib. objects, [ buildPath. appending ( components: " lib.build " , " lib.c.o " ) ] )
3030
- XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " module.modulemap " ) )
3032
+ XCTAssertEqual ( lib. moduleMap, buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) )
3031
3033
3032
3034
let exe = try result. target ( for: " app " ) . swiftTarget ( ) . compileArguments ( )
3033
3035
XCTAssertMatch (
3034
3036
exe,
3035
3037
[
3036
3038
" -swift-version " , " 4 " , " -enable-batch-mode " , " -Onone " , " -enable-testing " , " -g " ,
3037
3039
. equal( j) , " -DSWIFT_PACKAGE " , " -DDEBUG " , " -Xcc " ,
3038
- " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " module.modulemap " ) ) " ,
3040
+ " -fmodule-map-file= \( buildPath. appending ( components: " lib.build " , " Product " , " module.modulemap " ) ) " ,
3039
3041
" -Xcc " , " -I " , " -Xcc " , " \( Pkg . appending ( components: " Sources " , " lib " , " include " ) ) " ,
3040
3042
" -module-cache-path " , " \( buildPath. appending ( components: " ModuleCache " ) ) " , . anySequence
3041
3043
]
0 commit comments