File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,10 @@ extension Driver {
7474
7575 // Pass down -clang-target.
7676 // If not specified otherwise, we should use the same triple as -target
77+ // TODO: enable -clang-target for implicit module build as well.
7778 if !parsedOptions. hasArgument ( . disableClangTarget) &&
78- isFrontendArgSupported ( . clangTarget) {
79+ isFrontendArgSupported ( . clangTarget) &&
80+ parsedOptions. contains ( . driverExplicitModuleBuild) {
7981 let clangTriple = parsedOptions. getLastArgument ( . clangTarget) ? . asSingle ?? targetTriple. triple
8082 commandLine. appendFlag ( . clangTarget)
8183 commandLine. appendFlag ( clangTriple)
Original file line number Diff line number Diff line change @@ -3622,7 +3622,7 @@ final class SwiftDriverTests: XCTestCase {
36223622 #endif
36233623 }
36243624
3625- func testEnableClangTargetForImplicitModule ( ) throws {
3625+ func testDisableClangTargetForImplicitModule ( ) throws {
36263626 var envVars = ProcessEnv . vars
36273627 envVars [ " SWIFT_DRIVER_LD_EXEC " ] = ld. nativePathString ( escaped: false )
36283628
@@ -3632,7 +3632,7 @@ final class SwiftDriverTests: XCTestCase {
36323632 let plannedJobs = try driver. planBuild ( )
36333633 XCTAssertEqual ( plannedJobs. count, 2 )
36343634 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 " ) ) )
36363636 }
36373637
36383638 func testPCHasCompileInput( ) throws {
You can’t perform that action at this time.
0 commit comments