[PATCH] D109460: [clang][Darwin] Try to guess the SDK root with xcrun when unspecified

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 8 13:01:23 PDT 2021


ldionne created this revision.
ldionne added a reviewer: arphaman.
ldionne requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

On Apple platforms, the base system does not contain headers (e.g. in /usr/include).
As a result, one needs to point Clang to those headers manually when running it,
which can be cumbersome. Instead, if the SDK root can't be inferred with the
usual logic (using the SDKROOT env var), try to guess it by running 'xcrun'.

This should provide a default that's sane most of the time when running clang
without impeding the ability for users to select the SDK of their choice with
the usual means.

http://llvm.org/PR45880


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109460

Files:
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/test/Driver/darwin-sdkroot.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109460.371426.patch
Type: text/x-patch
Size: 5216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210908/9c4a720f/attachment.bin>


More information about the cfe-commits mailing list