@@ -3547,13 +3547,15 @@ final class BuildPlanTests: XCTestCase {
3547
3547
] ,
3548
3548
rootPaths: try UserToolchain . default. destination. toolset. rootPaths)
3549
3549
let runtimeTriple = try Triple ( " armv7em-unknown-none-macho " )
3550
+ let sdkIncludeSearchPath = " /usr/lib/swift_static/none/include "
3551
+ let sdkLibrarySearchPath = " /usr/lib/swift_static/none/lib "
3550
3552
let destination = try Destination (
3551
3553
runTimeTriple: runtimeTriple,
3552
3554
properties: . init(
3553
3555
sdkRootPath: " /fake/sdk " ,
3554
3556
swiftStaticResourcesPath: " /usr/lib/swift_static/none " ,
3555
- includeSearchPaths: [ " /usr/lib/swift_static/none " ] ,
3556
- librarySearchPaths: [ " /usr/lib/swift_static/none " ] ,
3557
+ includeSearchPaths: [ sdkIncludeSearchPath ] ,
3558
+ librarySearchPaths: [ sdkLibrarySearchPath ] ,
3557
3559
toolsetPaths: [ ] ) ,
3558
3560
toolset: toolSet,
3559
3561
destinationDirectory: nil )
@@ -3596,7 +3598,9 @@ final class BuildPlanTests: XCTestCase {
3596
3598
// Compile C Target
3597
3599
let cLibCompileArguments = try result. target ( for: " cLib " ) . clangTarget ( ) . basicArguments ( isCXX: false )
3598
3600
let cLibCompileArgumentsPattern : [ StringPattern ] = [
3599
- jsonFlag ( tool: . cCompiler) , cliFlag ( tool: . cCompiler) ,
3601
+ jsonFlag ( tool: . cCompiler) ,
3602
+ . equal( " -I \( sdkIncludeSearchPath) " ) ,
3603
+ cliFlag ( tool: . cCompiler) ,
3600
3604
]
3601
3605
XCTAssertMatch ( cLibCompileArguments, cLibCompileArgumentsPattern)
3602
3606
XCTAssertCount ( 0 , cLibCompileArguments, jsonFlag ( tool: . swiftCompiler) )
@@ -3611,9 +3615,13 @@ final class BuildPlanTests: XCTestCase {
3611
3615
// Compile Cxx Target
3612
3616
let cxxLibCompileArguments = try result. target ( for: " cxxLib " ) . clangTarget ( ) . basicArguments ( isCXX: true )
3613
3617
let cxxLibCompileArgumentsPattern : [ StringPattern ] = [
3614
- jsonFlag ( tool: . cCompiler) , cliFlag ( tool: . cCompiler) ,
3618
+ jsonFlag ( tool: . cCompiler) ,
3619
+ . equal( " -I \( sdkIncludeSearchPath) " ) ,
3620
+ cliFlag ( tool: . cCompiler) ,
3615
3621
. anySequence,
3616
- jsonFlag ( tool: . cxxCompiler) , cliFlag ( tool: . cxxCompiler)
3622
+ jsonFlag ( tool: . cxxCompiler) ,
3623
+ . equal( " -I \( sdkIncludeSearchPath) " ) ,
3624
+ cliFlag ( tool: . cxxCompiler)
3617
3625
]
3618
3626
XCTAssertMatch ( cxxLibCompileArguments, cxxLibCompileArgumentsPattern)
3619
3627
XCTAssertCount ( 0 , cxxLibCompileArguments, jsonFlag ( tool: . swiftCompiler) )
@@ -3628,13 +3636,19 @@ final class BuildPlanTests: XCTestCase {
3628
3636
// Compile Swift Target
3629
3637
let exeCompileArguments = try result. target ( for: " exe " ) . swiftTarget ( ) . compileArguments ( )
3630
3638
let exeCompileArgumentsPattern : [ StringPattern ] = [
3631
- jsonFlag ( tool: . swiftCompiler) , cliFlag ( tool: . swiftCompiler) ,
3639
+ jsonFlag ( tool: . swiftCompiler) ,
3640
+ . equal( " -I \( sdkIncludeSearchPath) " ) ,
3641
+ cliFlag ( tool: . swiftCompiler) ,
3632
3642
. anySequence,
3633
- " -Xcc " , jsonFlag ( tool: . cCompiler) , " -Xcc " , cliFlag ( tool: . cCompiler) ,
3643
+ " -Xcc " , jsonFlag ( tool: . cCompiler) ,
3644
+ " -Xcc " , . equal( " -I \( sdkIncludeSearchPath) " ) ,
3645
+ " -Xcc " , cliFlag ( tool: . cCompiler) ,
3634
3646
// TODO: Pass -Xcxx flags to swiftc (#6491)
3635
3647
// Uncomment when downstream support arrives.
3636
3648
// .anySequence,
3637
- // "-Xcxx", jsonFlag(tool: .cxxCompiler), "-Xcxx", cliFlag(tool: .cxxCompiler),
3649
+ // "-Xcxx", jsonFlag(tool: .cxxCompiler),
3650
+ // "-Xcc", .equal("-I\(sdkIncludeSearchPath)"),
3651
+ // "-Xcxx", cliFlag(tool: .cxxCompiler),
3638
3652
]
3639
3653
XCTAssertMatch ( exeCompileArguments, exeCompileArgumentsPattern)
3640
3654
XCTAssertCount ( 1 , exeCompileArguments, jsonFlag ( tool: . swiftCompiler) )
@@ -3651,9 +3665,13 @@ final class BuildPlanTests: XCTestCase {
3651
3665
// Link Product
3652
3666
let exeLinkArguments = try result. buildProduct ( for: " exe " ) . linkArguments ( )
3653
3667
let exeLinkArgumentsPattern : [ StringPattern ] = [
3654
- jsonFlag ( tool: . swiftCompiler) , cliFlag ( tool: . swiftCompiler) ,
3668
+ jsonFlag ( tool: . swiftCompiler) ,
3669
+ . equal( " -I \( sdkIncludeSearchPath) " ) ,
3670
+ cliFlag ( tool: . swiftCompiler) ,
3655
3671
. anySequence,
3656
- " -Xlinker " , jsonFlag ( tool: . linker) , " -Xlinker " , cliFlag ( tool: . linker) ,
3672
+ " -Xlinker " , jsonFlag ( tool: . linker) ,
3673
+ . equal( " -L \( sdkLibrarySearchPath) " ) ,
3674
+ " -Xlinker " , cliFlag ( tool: . linker) ,
3657
3675
]
3658
3676
XCTAssertMatch ( exeLinkArguments, exeLinkArgumentsPattern)
3659
3677
XCTAssertCount ( 1 , exeLinkArguments, jsonFlag ( tool: . swiftCompiler) )
0 commit comments