[all-commits] [llvm/llvm-project] ad8c34: [CMake] Avoid `LLVM_BINARY_DIR` when other more sp...

John Ericson via All-commits all-commits at lists.llvm.org
Wed Aug 24 07:14:25 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad8c34bc3089d847a09bb740f7a58c96073e0959
      https://github.com/llvm/llvm-project/commit/ad8c34bc3089d847a09bb740f7a58c96073e0959
  Author: John Ericson <John.Ericson at Obsidian.Systems>
  Date:   2022-08-24 (Wed, 24 Aug 2022)

  Changed paths:
    M bolt/lib/Target/AArch64/CMakeLists.txt
    M bolt/lib/Target/X86/CMakeLists.txt
    M bolt/unittests/Core/CMakeLists.txt
    M clang/cmake/modules/CMakeLists.txt
    M clang/lib/Tooling/CMakeLists.txt
    M flang/cmake/modules/CMakeLists.txt
    M lld/cmake/modules/CMakeLists.txt
    M lldb/cmake/modules/LLDBConfig.cmake
    M lldb/test/API/CMakeLists.txt
    M llvm/CMakeLists.txt
    M llvm/cmake/modules/AddLLVM.cmake
    M llvm/cmake/modules/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
    M llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
    M llvm/tools/llvm-shlib/CMakeLists.txt
    M llvm/unittests/Target/ARM/CMakeLists.txt
    M llvm/unittests/Target/DirectX/CMakeLists.txt
    M llvm/unittests/tools/llvm-exegesis/AArch64/CMakeLists.txt
    M llvm/unittests/tools/llvm-exegesis/ARM/CMakeLists.txt
    M llvm/unittests/tools/llvm-exegesis/Mips/CMakeLists.txt
    M llvm/unittests/tools/llvm-exegesis/PowerPC/CMakeLists.txt
    M llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
    M llvm/unittests/tools/llvm-mca/X86/CMakeLists.txt
    M mlir/cmake/modules/CMakeLists.txt
    M polly/cmake/CMakeLists.txt
    M polly/test/CMakeLists.txt

  Log Message:
  -----------
  [CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited

A simple sed doing these substitutions:

- `${LLVM_BINARY_DIR}/(\$\{CMAKE_CFG_INTDIR}/)?lib(${LLVM_LIBDIR_SUFFIX})?\>` -> `${LLVM_LIBRARY_DIR}`
- `${LLVM_BINARY_DIR}/(\$\{CMAKE_CFG_INTDIR}/)?bin\>` -> `${LLVM_TOOLS_BINARY_DIR}`

where `\>` means "word boundary".

The only manual modifications were reverting changes in

- `compiler-rt/cmake/Modules/CompilerRTUtils.cmake
- `runtimes/CMakeLists.txt`

because these were "entry points" where we wanted to tread carefully not not introduce a "loop" which would end with an undefined variable being expanded to nothing.

This hopefully increases readability overall, and also decreases the usages of `LLVM_LIBDIR_SUFFIX`, preparing us for D130586.

Reviewed By: sebastian-ne

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




More information about the All-commits mailing list