[Lldb-commits] [PATCH] D57995: [lldb] [cmake] Use install directories for LLVM_* variables

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 12 03:28:24 PST 2019


sgraenitz added a comment.

In D57995#1394412 <https://reviews.llvm.org/D57995#1394412>, @mgorny wrote:

> Indeed it is a problem. However, it seems to be a bug that `LLVM_INCLUDE_DIR` contains two directories.


Yes, especially since we also have `LLVM_INCLUDE_DIRS`. But that's not the end.. in `llvm/cmake/modules/CMakeLists.txt` we set:

  set(LLVM_CONFIG_INCLUDE_DIRS
    "${LLVM_MAIN_INCLUDE_DIR}"
    "${LLVM_INCLUDE_DIR}"
    )

The `LLVMConfig.cmake.in` template stores it as:

  set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@")
  set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@")
  
  # These variables are duplicated, but they must match the LLVM variables of the
  # same name. The variables ending in "S" could some day become lists, and are
  # preserved for convention and compatibility.
  set(LLVM_INCLUDE_DIR "@LLVM_CONFIG_INCLUDE_DIRS@")
  set(LLVM_LIBRARY_DIR "@LLVM_CONFIG_LIBRARY_DIRS@")

The install step fixes that and generates:

  set(LLVM_INCLUDE_DIR "${LLVM_INSTALL_PREFIX}/include")
  set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")

Result:

- LLVM itself and clients of the install-tree see `LLVM_INCLUDE_DIR=/path/to/llvm-build/include`
- Clients of the build-tree see `LLVM_INCLUDE_DIR=/path/to/llvm/include;/path/to/llvm-build/include`

This should really be fixed. Looks like the confusion started with https://reviews.llvm.org/rL280013 and manifested with https://reviews.llvm.org/rL280380.

> In other words, it's a mess ;-/.

Yes, definitely


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

https://reviews.llvm.org/D57995





More information about the lldb-commits mailing list