From ad8c34bc3089d847a09bb740f7a58c96073e0959 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 20 Aug 2022 18:11:58 -0400 Subject: [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 --- polly/cmake/CMakeLists.txt | 2 +- polly/test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'polly') diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt index 4c528d5..1834107 100644 --- a/polly/cmake/CMakeLists.txt +++ b/polly/cmake/CMakeLists.txt @@ -12,7 +12,7 @@ set(polly_cmake_builddir "${POLLY_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/pol set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") +set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm") if (CMAKE_CONFIGURATION_TYPES) set(POLLY_EXPORTS_FILE_NAME "PollyExports-$>.cmake") diff --git a/polly/test/CMakeLists.txt b/polly/test/CMakeLists.txt index 358d7a5..91923ef 100644 --- a/polly/test/CMakeLists.txt +++ b/polly/test/CMakeLists.txt @@ -46,7 +46,7 @@ endif () set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}") -set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") +set(LLVM_LIBS_DIR "${LLVM_LIBRARY_DIR}") if (CMAKE_LIBRARY_OUTPUT_DIRECTORY) set(POLLY_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) else() -- cgit v1.1