Skip to content

Commit 3031fa8

Browse files
committed
Enable '-clang-target' by-default
This will result in the driver passing down '-clang-target' flag to the frontend, which will then ensure that all downstream module (Swift and Clang) compilation compiler sub-invocations are consistent with respect to the target triple used by their underlying instances of Clang. Resulting in all Clang module dependencies being built against the main module's target triple.
1 parent cee8c66 commit 3031fa8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ 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.
7877
if !parsedOptions.hasArgument(.disableClangTarget) &&
79-
isFrontendArgSupported(.clangTarget) &&
80-
parsedOptions.contains(.driverExplicitModuleBuild) {
78+
isFrontendArgSupported(.clangTarget) {
8179
let clangTriple = parsedOptions.getLastArgument(.clangTarget)?.asSingle ?? targetTriple.triple
8280
commandLine.appendFlag(.clangTarget)
8381
commandLine.appendFlag(clangTriple)

0 commit comments

Comments
 (0)