In this case we interpret the path as relative the clang binary.
This allows SDKs to be build that include clang along with a custom
sysroot without requiring users to specify --sysroot to point to the
directory where they install the SDK.
Differential D76653
[clang] Allow -DDEFAULT_SYSROOT to be a relative path sbc100 on Mar 23 2020, 5:06 PM. Authored by
Details In this case we interpret the path as relative the clang binary. This allows SDKs to be build that include clang along with a custom
Diff Detail
Event TimelineComment Actions I have no idea how to write a test for this, but I tested it locally with wasi SDK. Hopefully fucia will find this useful too as a generic version of https://reviews.llvm.org/D42019
Comment Actions Hmm.. arc diff was behaving strangely for me and failed to update this PR as I expected. Should fixed now.
|
I don't think this is an intended use for GetResourcesPath since this is not a resource path. Since you set custom resource dir, this is equivalent to:
On line 144 we already set Dir = llvm::sys::path::parent_path(ClangExecutable), so if you move this below you can just use SysRoot = llvm::sys::path::append(Dir, SysRoot) which should be sufficient.