Skip to content

CLANG_RESOURCE_DIR is not respected in some subprojects #59726

@paperchalice

Description

@paperchalice

There is a configurable variable CLANG_RESOURCE_DIR, if I understand the docstring and source code correctly, some subprojects should install their files like headers, into this directory.

ResourceDir = GetResourcesPath(ClangExecutable, CLANG_RESOURCE_DIR);

if (CustomResourceDir != "") {
llvm::sys::path::append(P, CustomResourceDir);
} else {
// On Windows, libclang.dll is in bin/.
// On non-Windows, libclang.so/.dylib is in lib/.
// With a static-library build of libclang, LibClangPath will contain the
// path of the embedding binary, which for LLVM binaries will be in bin/.
// ../lib gets us to lib/ in both cases.
P = llvm::sys::path::parent_path(Dir);
llvm::sys::path::append(P, CLANG_INSTALL_LIBDIR_BASENAME, "clang",
CLANG_VERSION_MAJOR_STRING);


clang:

set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION_MAJOR}/include)

-I ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION_MAJOR}/include

compiler-rt:

set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION_MAJOR})
set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR})

llvm:

set(resource_dir "${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION_MAJOR}")

openmp:

set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularrelease:backport

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions