mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Explicit Module Builds] Add '-clang-target-variant' flag
https://github.com/swiftlang/swift/pull/37774 added '-clang-target' which allows us to specify a target triple that only differs from '-target' by the OS version, when we want to provide a different OS version for API availability and type-checking, in order to set a common/unified target triple for the entire Clang module dependency graph, for presenting a unified API surface to the Swift client, serving as a maximum type-checking epoch. This change adds an equivalent flag for the '-target-variant' configuration, as a mechanism to ensure that the entire module dependency graph presents a consistent os version.
This commit is contained in:
@@ -1433,9 +1433,10 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
// necessary because the textual interface hardcoded the proper target triple
|
||||
// to use. Inferring -clang-target there will always give us the default
|
||||
// target triple.
|
||||
if (const Arg *A = Args.getLastArg(OPT_clang_target)) {
|
||||
if (const Arg *A = Args.getLastArg(OPT_clang_target))
|
||||
Opts.ClangTarget = llvm::Triple(A->getValue());
|
||||
}
|
||||
if (const Arg *A = Args.getLastArg(OPT_clang_target_variant))
|
||||
Opts.ClangTargetVariant = llvm::Triple(A->getValue());
|
||||
|
||||
Opts.setCxxInteropFromArgs(Args, Diags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user