[CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited
authorJohn Ericson <John.Ericson@Obsidian.Systems>
Sat, 20 Aug 2022 22:11:58 +0000 (18:11 -0400)
committerJohn Ericson <John.Ericson@Obsidian.Systems>
Wed, 24 Aug 2022 14:14:05 +0000 (10:14 -0400)
commitad8c34bc3089d847a09bb740f7a58c96073e0959
treec6f6eb4a8e721925e87a1e6647a9fb3d26d2bf65
parent8e29f3f1c35a88f00a0290b0280468d04932eeb5
[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
28 files changed:
bolt/lib/Target/AArch64/CMakeLists.txt
bolt/lib/Target/X86/CMakeLists.txt
bolt/unittests/Core/CMakeLists.txt
clang/cmake/modules/CMakeLists.txt
clang/lib/Tooling/CMakeLists.txt
flang/cmake/modules/CMakeLists.txt
lld/cmake/modules/CMakeLists.txt
lldb/cmake/modules/LLDBConfig.cmake
lldb/test/API/CMakeLists.txt
llvm/CMakeLists.txt
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
llvm/tools/llvm-shlib/CMakeLists.txt
llvm/unittests/Target/ARM/CMakeLists.txt
llvm/unittests/Target/DirectX/CMakeLists.txt
llvm/unittests/tools/llvm-exegesis/AArch64/CMakeLists.txt
llvm/unittests/tools/llvm-exegesis/ARM/CMakeLists.txt
llvm/unittests/tools/llvm-exegesis/Mips/CMakeLists.txt
llvm/unittests/tools/llvm-exegesis/PowerPC/CMakeLists.txt
llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
llvm/unittests/tools/llvm-mca/X86/CMakeLists.txt
mlir/cmake/modules/CMakeLists.txt
polly/cmake/CMakeLists.txt
polly/test/CMakeLists.txt