[Lldb-commits] [lldb] ad8c34b - [CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited
John Ericson via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 24 07:14:16 PDT 2022
Author: John Ericson
Date: 2022-08-24T10:14:05-04:00
New Revision: ad8c34bc3089d847a09bb740f7a58c96073e0959
URL: https://github.com/llvm/llvm-project/commit/ad8c34bc3089d847a09bb740f7a58c96073e0959
DIFF: https://github.com/llvm/llvm-project/commit/ad8c34bc3089d847a09bb740f7a58c96073e0959.diff
LOG: [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
Added:
Modified:
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
Removed:
################################################################################
diff --git a/bolt/lib/Target/AArch64/CMakeLists.txt b/bolt/lib/Target/AArch64/CMakeLists.txt
index 96c70168196e0..1e7ee71f2c300 100644
--- a/bolt/lib/Target/AArch64/CMakeLists.txt
+++ b/bolt/lib/Target/AArch64/CMakeLists.txt
@@ -14,5 +14,5 @@ add_llvm_library(LLVMBOLTTargetAArch64
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
- ${LLVM_BINARY_DIR}/lib/Target/AArch64
+ ${LLVM_LIBRARY_DIR}/Target/AArch64
)
diff --git a/bolt/lib/Target/X86/CMakeLists.txt b/bolt/lib/Target/X86/CMakeLists.txt
index 47344fe331115..a194148adf98c 100644
--- a/bolt/lib/Target/X86/CMakeLists.txt
+++ b/bolt/lib/Target/X86/CMakeLists.txt
@@ -17,5 +17,5 @@ add_llvm_library(LLVMBOLTTargetX86
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
- ${LLVM_BINARY_DIR}/lib/Target/X86
+ ${LLVM_LIBRARY_DIR}/Target/X86
)
diff --git a/bolt/unittests/Core/CMakeLists.txt b/bolt/unittests/Core/CMakeLists.txt
index 0e78d0a2746f4..9e9c1013b21f7 100644
--- a/bolt/unittests/Core/CMakeLists.txt
+++ b/bolt/unittests/Core/CMakeLists.txt
@@ -20,7 +20,7 @@ target_link_libraries(CoreTests
if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
- ${LLVM_BINARY_DIR}/lib/Target/AArch64
+ ${LLVM_LIBRARY_DIR}/Target/AArch64
)
target_compile_definitions(CoreTests PRIVATE AARCH64_AVAILABLE)
@@ -29,7 +29,7 @@ endif()
if ("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
- ${LLVM_BINARY_DIR}/lib/Target/X86
+ ${LLVM_LIBRARY_DIR}/Target/X86
)
target_compile_definitions(CoreTests PRIVATE X86_AVAILABLE)
diff --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt
index 6a7fa2fa27ebb..880d51f5aef71 100644
--- a/clang/cmake/modules/CMakeLists.txt
+++ b/clang/cmake/modules/CMakeLists.txt
@@ -15,7 +15,7 @@ set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/cla
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")
get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt
index 403d2dfb45e8e..e35e7f9be0009 100644
--- a/clang/lib/Tooling/CMakeLists.txt
+++ b/clang/lib/Tooling/CMakeLists.txt
@@ -60,7 +60,7 @@ else()
$<TARGET_FILE:clang-ast-dump>
# Skip this in debug mode because parsing AST.h is too slow
--skip-processing=${skip_expensive_processing}
- -I ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include
+ -I ${LLVM_LIBRARY_DIR}/clang/${CLANG_VERSION}/include
-I ${CLANG_SOURCE_DIR}/include
-I ${LLVM_BINARY_DIR}/tools/clang/include
-I ${LLVM_BINARY_DIR}/include
diff --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt
index 105cc09bf8501..31a6c3c83e48b 100644
--- a/flang/cmake/modules/CMakeLists.txt
+++ b/flang/cmake/modules/CMakeLists.txt
@@ -14,7 +14,7 @@ set(flang_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/fla
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")
get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS)
export(TARGETS ${FLANG_EXPORTS} FILE ${flang_cmake_builddir}/FlangTargets.cmake)
diff --git a/lld/cmake/modules/CMakeLists.txt b/lld/cmake/modules/CMakeLists.txt
index 57195bce45c95..61e7a1fe2752f 100644
--- a/lld/cmake/modules/CMakeLists.txt
+++ b/lld/cmake/modules/CMakeLists.txt
@@ -14,7 +14,7 @@ set(lld_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/lld")
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")
get_property(LLD_EXPORTS GLOBAL PROPERTY LLD_EXPORTS)
export(TARGETS ${LLD_EXPORTS} FILE ${lld_cmake_builddir}/LLDTargets.cmake)
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 987353517d0d5..2dd14d05a92aa 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -276,7 +276,7 @@ if (NOT TARGET clang-resource-headers)
# could be and pick the first that exists.
foreach(CANDIDATE "${Clang_DIR}/../.." "${LLVM_DIR}" "${LLVM_LIBRARY_DIRS}"
"${LLVM_BUILD_LIBRARY_DIR}"
- "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
+ "${LLVM_LIBRARY_DIR}")
# Build the resource directory path by appending 'clang/<version number>'.
set(CANDIDATE_RESOURCE_DIR "${CANDIDATE}/clang/${LLDB_CLANG_RESOURCE_DIR_NAME}")
if (IS_DIRECTORY "${CANDIDATE_RESOURCE_DIR}")
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 0078984c46b23..afaeabf8814e6 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -45,10 +45,10 @@ set(LLDB_TEST_COMMON_ARGS
# Set the path to the default lldb test executable.
set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
-set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
+set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_TOOLS_BINARY_DIR}/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
if (TARGET clang)
- set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
+ set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_TOOLS_BINARY_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}")
else()
set(LLDB_DEFAULT_TEST_COMPILER "")
endif()
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 1c1a38d102a60..c6fcb1bd2c608 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -921,9 +921,9 @@ configure_file(
)
# They are not referenced. See set_output_directory().
-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
-set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
-set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
+set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_LIBRARY_DIR} )
+set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_LIBRARY_DIR} )
if(LLVM_INCLUDE_TESTS)
include(GetErrcMessages)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 057431208322e..e5f2a70403617 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1093,7 +1093,7 @@ function(process_llvm_pass_plugins)
message(FATAL_ERROR "LLVM_INSTALL_PACKAGE_DIR must be defined and writable. GEN_CONFIG should only be passe when building LLVM proper.")
endif()
# LLVM_INSTALL_PACKAGE_DIR 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")
file(WRITE
"${llvm_cmake_builddir}/LLVMConfigExtensions.cmake"
"set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})")
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 470881516915a..428d8bff1cc66 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -3,7 +3,7 @@ include(LLVMDistributionSupport)
include(FindPrefixFromConfig)
# 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")
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
set(LLVM_EXPORTS_FILE ${llvm_cmake_builddir}/LLVMExports.cmake)
diff --git a/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
index e416d806de62d..7ff7c18bad9d2 100644
--- a/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
- ${LLVM_BINARY_DIR}/lib/Target/AArch64
+ ${LLVM_LIBRARY_DIR}/Target/AArch64
)
set(LLVM_LINK_COMPONENTS
diff --git a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
index ecf659037fed3..a4dec858554e2 100644
--- a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/Mips
- ${LLVM_BINARY_DIR}/lib/Target/Mips
+ ${LLVM_LIBRARY_DIR}/Target/Mips
)
set(LLVM_LINK_COMPONENTS
diff --git a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
index 29e7f5783432a..b351833cdaa5b 100644
--- a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC
- ${LLVM_BINARY_DIR}/lib/Target/PowerPC
+ ${LLVM_LIBRARY_DIR}/Target/PowerPC
)
set(LLVM_LINK_COMPONENTS
diff --git a/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
index da30b9bf5897a..51755eb4b4815 100644
--- a/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
- ${LLVM_BINARY_DIR}/lib/Target/X86
+ ${LLVM_LIBRARY_DIR}/Target/X86
)
set(LLVM_LINK_COMPONENTS
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
index 8e2b78f1b85c0..fd4999fff6764 100644
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -88,7 +88,7 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND NOT MSVC)
set(LLVM_EXPORTED_SYMBOL_FILE ${LLVM_BINARY_DIR}/libllvm-c.exports)
- set(LIB_DIR ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
+ set(LIB_DIR ${LLVM_LIBRARY_DIR})
set(LIB_NAME ${LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}LLVM)
set(LIB_PATH ${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(LIB_EXPORTS_PATH ${LIB_NAME}.exports)
@@ -136,7 +136,7 @@ if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC)
# Get the full name to the libs so the python script understands them.
foreach(lib ${LIB_NAMES})
- list(APPEND FULL_LIB_NAMES ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${lib}.lib)
+ list(APPEND FULL_LIB_NAMES ${LLVM_LIBRARY_DIR}/${lib}.lib)
endforeach()
# Need to separate lib names with newlines.
diff --git a/llvm/unittests/Target/ARM/CMakeLists.txt b/llvm/unittests/Target/ARM/CMakeLists.txt
index 219e0cc2efb58..1803ac35f03a4 100644
--- a/llvm/unittests/Target/ARM/CMakeLists.txt
+++ b/llvm/unittests/Target/ARM/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/ARM
- ${LLVM_BINARY_DIR}/lib/Target/ARM
+ ${LLVM_LIBRARY_DIR}/Target/ARM
)
set(LLVM_LINK_COMPONENTS
diff --git a/llvm/unittests/Target/DirectX/CMakeLists.txt b/llvm/unittests/Target/DirectX/CMakeLists.txt
index 621b00ae65d3a..6cef27fc22e0d 100644
--- a/llvm/unittests/Target/DirectX/CMakeLists.txt
+++ b/llvm/unittests/Target/DirectX/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(
${LLVM_MAIN_SRC_DIR}/lib/Target/DirectX
- ${LLVM_BINARY_DIR}/lib/Target/DirectX
+ ${LLVM_LIBRARY_DIR}/Target/DirectX
)
set(LLVM_LINK_COMPONENTS
diff --git a/llvm/unittests/tools/llvm-exegesis/AArch64/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/AArch64/CMakeLists.txt
index b99510418bfc3..74fedf3ebe3e7 100644
--- a/llvm/unittests/tools/llvm-exegesis/AArch64/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-exegesis/AArch64/CMakeLists.txt
@@ -1,6 +1,6 @@
add_llvm_exegesis_unittest_includes(
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
- ${LLVM_BINARY_DIR}/lib/Target/AArch64
+ ${LLVM_LIBRARY_DIR}/Target/AArch64
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
)
diff --git a/llvm/unittests/tools/llvm-exegesis/ARM/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/ARM/CMakeLists.txt
index 097a20d542d72..2daa23b1cbc0b 100644
--- a/llvm/unittests/tools/llvm-exegesis/ARM/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-exegesis/ARM/CMakeLists.txt
@@ -1,6 +1,6 @@
add_llvm_exegesis_unittest_includes(
${LLVM_MAIN_SRC_DIR}/lib/Target/ARM
- ${LLVM_BINARY_DIR}/lib/Target/ARM
+ ${LLVM_LIBRARY_DIR}/Target/ARM
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
)
diff --git a/llvm/unittests/tools/llvm-exegesis/Mips/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/Mips/CMakeLists.txt
index 102a86c45189d..278bd6911b07c 100644
--- a/llvm/unittests/tools/llvm-exegesis/Mips/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-exegesis/Mips/CMakeLists.txt
@@ -1,6 +1,6 @@
add_llvm_exegesis_unittest_includes(
${LLVM_MAIN_SRC_DIR}/lib/Target/Mips
- ${LLVM_BINARY_DIR}/lib/Target/Mips
+ ${LLVM_LIBRARY_DIR}/Target/Mips
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
)
diff --git a/llvm/unittests/tools/llvm-exegesis/PowerPC/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/PowerPC/CMakeLists.txt
index 20e7d5d2b825d..d45e65893d3d7 100644
--- a/llvm/unittests/tools/llvm-exegesis/PowerPC/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-exegesis/PowerPC/CMakeLists.txt
@@ -1,6 +1,6 @@
add_llvm_exegesis_unittest_includes(
${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC
- ${LLVM_BINARY_DIR}/lib/Target/PowerPC
+ ${LLVM_LIBRARY_DIR}/Target/PowerPC
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
)
diff --git a/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
index 9ce547ddaadbd..a2cf4e8498b59 100644
--- a/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-exegesis/X86/CMakeLists.txt
@@ -1,6 +1,6 @@
add_llvm_exegesis_unittest_includes(
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
- ${LLVM_BINARY_DIR}/lib/Target/X86
+ ${LLVM_LIBRARY_DIR}/Target/X86
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
)
diff --git a/llvm/unittests/tools/llvm-mca/X86/CMakeLists.txt b/llvm/unittests/tools/llvm-mca/X86/CMakeLists.txt
index 42925f6f42a89..4273f6bc85e76 100644
--- a/llvm/unittests/tools/llvm-mca/X86/CMakeLists.txt
+++ b/llvm/unittests/tools/llvm-mca/X86/CMakeLists.txt
@@ -1,6 +1,6 @@
add_llvm_mca_unittest_includes(
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
- ${LLVM_BINARY_DIR}/lib/Target/X86
+ ${LLVM_LIBRARY_DIR}/Target/X86
)
add_llvm_mca_unittest_sources(
diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 5fd9454cad93e..a6addd7735829 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -15,7 +15,7 @@ set(mlir_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir
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")
get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS)
export(TARGETS ${MLIR_EXPORTS} FILE ${mlir_cmake_builddir}/MLIRTargets.cmake)
diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt
index 4c528d562e23b..183410734cef0 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-$<LOWER_CASE:$<CONFIG>>.cmake")
diff --git a/polly/test/CMakeLists.txt b/polly/test/CMakeLists.txt
index 358d7a561225a..91923ef9f0392 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()
More information about the lldb-commits
mailing list