[clang] [clang][driver][darwin] Prefer DarwinSDKInfo for platform identification and compatibility over the -isysroot path (PR #176541)
Cyndy Ishida via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 20 07:21:36 PST 2026
================
@@ -2598,15 +2656,20 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
<< TargetVariantTriple->str();
}
- if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
+ if (SDKInfo) {
+ if (!SDKInfo->supportsPlatformInfo(PlatformAndVersion->getPlatformInfo())) {
+ getDriver().Diag(diag::warn_incompatible_sysroot)
----------------
cyndyishida wrote:
Could you delay checking for this until the target triple is computed? That way, you don't need to add as many helpers for handling pieces of what will become the use target triple, like the new comparator, which looks identical to the one already for comparing `Triple` and `SDKPlatformInfo` and `getPlatformAndEnvironmentString`.
https://github.com/llvm/llvm-project/pull/176541
More information about the cfe-commits
mailing list