File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,10 @@ extension Driver {
74
74
75
75
// Pass down -clang-target.
76
76
// If not specified otherwise, we should use the same triple as -target
77
+ // TODO: enable -clang-target for implicit module build as well.
77
78
if !parsedOptions. hasArgument ( . disableClangTarget) &&
78
- isFrontendArgSupported ( . clangTarget) {
79
+ isFrontendArgSupported ( . clangTarget) &&
80
+ parsedOptions. contains ( . driverExplicitModuleBuild) {
79
81
let clangTriple = parsedOptions. getLastArgument ( . clangTarget) ? . asSingle ?? targetTriple. triple
80
82
commandLine. appendFlag ( . clangTarget)
81
83
commandLine. appendFlag ( clangTriple)
Original file line number Diff line number Diff line change @@ -3622,7 +3622,7 @@ final class SwiftDriverTests: XCTestCase {
3622
3622
#endif
3623
3623
}
3624
3624
3625
- func testEnableClangTargetForImplicitModule ( ) throws {
3625
+ func testDisableClangTargetForImplicitModule ( ) throws {
3626
3626
var envVars = ProcessEnv . vars
3627
3627
envVars [ " SWIFT_DRIVER_LD_EXEC " ] = ld. nativePathString ( escaped: false )
3628
3628
@@ -3632,7 +3632,7 @@ final class SwiftDriverTests: XCTestCase {
3632
3632
let plannedJobs = try driver. planBuild ( )
3633
3633
XCTAssertEqual ( plannedJobs. count, 2 )
3634
3634
XCTAssert ( plannedJobs [ 0 ] . commandLine. contains ( . flag( " -target " ) ) )
3635
- XCTAssertTrue ( plannedJobs [ 0 ] . commandLine. contains ( . flag( " -clang-target " ) ) )
3635
+ XCTAssertFalse ( plannedJobs [ 0 ] . commandLine. contains ( . flag( " -clang-target " ) ) )
3636
3636
}
3637
3637
3638
3638
func testPCHasCompileInput( ) throws {
You can’t perform that action at this time.
0 commit comments