[PATCH] D134597: [CMake] install clang resource headers into `CLANG_RESOURCE_DIR/include` if `CLANG_RESOURCE_DIR` is not empty

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 23:47:59 PDT 2022


phosek added inline comments.


================
Comment at: clang/lib/Headers/CMakeLists.txt:266
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
----------------
The property we maintain is that the build directory layout matches the installation directory which makes it possible to use the toolchain without having to install it first.

I believe we need to set the `output_dir` depending on the value of `CLANG_RESOURCE_DIR` as well to preserve that behavior.


================
Comment at: clang/lib/Headers/CMakeLists.txt:423-426
 set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+if(NOT CLANG_RESOURCE_DIR STREQUAL "")
+  set(header_install_dir ${CMAKE_INSTALL_BINDIR}/${CLANG_RESOURCE_DIR}/include)
+endif()
----------------
nit: can we use `if ... else`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134597/new/

https://reviews.llvm.org/D134597



More information about the cfe-commits mailing list