[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected
Tom Stellard via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 5 07:12:07 PDT 2023
tstellar added inline comments.
================
Comment at: cmake/Modules/GetClangResourceDir.cmake:13
+ if(DEFINED CLANG_RESOURCE_DIR AND NOT CLANG_RESOURCE_DIR STREQUAL "")
+ set(ret_dir bin/${CLANG_RESOURCE_DIR})
+ else()
----------------
tstellar wrote:
> tstellar wrote:
> > paperchalice wrote:
> > > tstellar wrote:
> > > > Why is the bin prefix here?
> > > See https://clang.llvm.org/doxygen/classclang_1_1driver_1_1Driver.html#acda8dfdf4f80efa84df98157e1779152
> > > `GetResourcesPath` will return `<prefix>/lib/<version>` when `CLANG_RESOURCE_DIR` is empty, `<prefix>/bin/CLANG_RESOURCE_DIR` otherwise.
> > >
> > `GetResourcesPath` calls `sys::path::parent_path` twice on the path to the clang executable which is going to give you `/usr ` on most Linux systems, so it's returning `<prefix>/CLANG_RESOURCE_DIR` not `<prefix>/bin/CLANG_RESOURCE_DIR`.
> Sorry, you are correct. I was looking at the wrong branch. It's really strange that it does that.
@paperchalice Can you update the description of the CLANG_RESOURCE_DIR cache variable in clang/CMakeLists.txt to mention that the path should be relative to the directory with the clang executable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141907/new/
https://reviews.llvm.org/D141907
More information about the cfe-commits
mailing list