[PATCH] D117977: [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore

Stella Stamenova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 26 13:00:14 PDT 2022


stella.stamenova added a comment.

This change broke the `LLVMConfig` generation and now when including `llvm` through `LLVM_DIR` in another project such as `onnx-mlir`, various tools no longer have the correct paths. For example, before this change:

  set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin")
  set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_INSTALL_PREFIX}/bin/llvm-lit")

After this change:

  set(LLVM_DEFAULT_EXTERNAL_LIT "/__w/1/b/llvm/Release/./bin/llvm-lit")
  set(LLVM_TOOLS_BINARY_DIR "/__w/1/b/llvm/Release/./bin")

Note that the new paths are both _absolute_ paths (which is not great for an install scenario) as well as _wrong_ because they point to the build directory even in an install scenario.

The offending line is actually one that was removed from here: `/llvm-project/llvm/cmake/modules/CMakeLists.txt`:

  extend_path(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}" "${LLVM_TOOLS_INSTALL_DIR}")

Previously (before this line was removed), `LLVM_CONFIG_TOOLS_BINARY_DIR ` was set to the join of `LLVM_TOOLS_INSTALL_DIR` and `LLVM_INSTALL_PREFIX`, but now that this is gone, it is simply set to:

  set(LLVM_CONFIG_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")

where `LLVM_TOOLS_BINARY_DIR` is an absolute path to the binary directory (which is fine for `LLVMConfig` in the binary tree) and `LLVM_CONFIG_TOOLS_BINARY_DIR ` is never updated to point to an install location for the install tree.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117977



More information about the cfe-commits mailing list