[all-commits] [llvm/llvm-project] fac791: Export `LLVM_VERSION_MAJOR` CMake variable as a di...

Benoit Jacob via All-commits all-commits at lists.llvm.org
Tue Mar 5 06:59:40 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fac791d4e1d879c19bfbbbfa89dc4186f56af34c
      https://github.com/llvm/llvm-project/commit/fac791d4e1d879c19bfbbbfa89dc4186f56af34c
  Author: Benoit Jacob <jacob.benoit.1 at gmail.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M llvm/CMakeLists.txt

  Log Message:
  -----------
  Export `LLVM_VERSION_MAJOR` CMake variable as a directory property (#83346)

This allows users who include `llvm-project` as a subrepository to
access the `LLVM_VERSION_MAJOR` variable on par with if they were
relying on an installed LLVM and `FindLLVM.cmake`. They just need to do
something like:

```
  get_directory_property(LLVM_VERSION_MAJOR DIRECTORY "third_party/llvm-project/llvm" LLVM_VERSION_MAJOR)
```

Context: https://github.com/openxla/iree/pull/16606 -- like other
projects with similar needs that I found by some googling, our
work-around had been to rely on the CMake cached variable
`CLANG_EXECUTABLE_VERSION`. Being cached, it over time inevitably ended
up having a wrong value.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list