[all-commits] [llvm/llvm-project] d23005: [llvm] [cmake] Move LLVM_INSTALL_PACKAGE_DIR top-l...

Michał Górny via All-commits all-commits at lists.llvm.org
Mon Aug 15 08:21:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d230055234863aafe63489f9ab95e52d2c1883f2
      https://github.com/llvm/llvm-project/commit/d230055234863aafe63489f9ab95e52d2c1883f2
  Author: Michał Górny <mgorny at gentoo.org>
  Date:   2022-08-15 (Mon, 15 Aug 2022)

  Changed paths:
    M llvm/CMakeLists.txt
    M llvm/cmake/modules/CMakeLists.txt

  Log Message:
  -----------
  [llvm] [cmake] Move LLVM_INSTALL_PACKAGE_DIR top-level to fix llvm-config

Move the `LLVM_INSTALL_PACKAGE_DIR` declaration from llvm/cmake/modules
directory to the top-level llvm/CMakeLists.txt, in order to fix
the regression in `llvm-config --cmakedir` output for installed LLVM.
Since the tools directory is processed by CMake prior to
llvm/cmake/modules, the llvm-config executable ended up using
the variable prior to it being defined and incorrectly used an empty
path, resulting in e.g.:

    $ llvm-config --cmakedir
    /usr/lib/llvm/16/

With this patch, the path is defined (and therefore the default value
is being set) prior to adding the tools subdirectory and llvm-config
starts working correctly:

    $ llvm-config --cmakedir
    /usr/lib/llvm/16/lib64/cmake/llvm

This fixes a regression introduced by D130539.  Thanks to Petr Polezhaev
for reporting the problem @ https://bugs.gentoo.org/865165

Differential Revision: https://reviews.llvm.org/D131878




More information about the All-commits mailing list