mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "Revert "Use autolinking to pull in compatibility libraries.""
This commit is contained in:
@@ -1155,6 +1155,30 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
A->getAsString(Args), A->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// Autolink runtime compatibility libraries, if asked to.
|
||||
if (!Args.hasArg(options::OPT_disable_autolinking_runtime_compatibility)) {
|
||||
Optional<llvm::VersionTuple> runtimeCompatibilityVersion;
|
||||
|
||||
if (auto versionArg = Args.getLastArg(
|
||||
options::OPT_runtime_compatibility_version)) {
|
||||
auto version = StringRef(versionArg->getValue());
|
||||
if (version.equals("none")) {
|
||||
runtimeCompatibilityVersion = None;
|
||||
} else if (version.equals("5.0")) {
|
||||
runtimeCompatibilityVersion = llvm::VersionTuple(5, 0);
|
||||
} else {
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
versionArg->getAsString(Args), version);
|
||||
}
|
||||
} else {
|
||||
runtimeCompatibilityVersion =
|
||||
getSwiftRuntimeCompatibilityVersionForTarget(Triple);
|
||||
}
|
||||
|
||||
Opts.AutolinkRuntimeCompatibilityLibraryVersion =
|
||||
runtimeCompatibilityVersion;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user