forked from OSchip/llvm-project
Revert "[CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited"
This reverts commit ad8c34bc30
.
This commit is contained in:
parent
f7bbe099c9
commit
34fe6ddce1
|
@ -14,5 +14,5 @@ add_llvm_library(LLVMBOLTTargetAArch64
|
|||
|
||||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
|
||||
${LLVM_LIBRARY_DIR}/Target/AArch64
|
||||
${LLVM_BINARY_DIR}/lib/Target/AArch64
|
||||
)
|
||||
|
|
|
@ -17,5 +17,5 @@ add_llvm_library(LLVMBOLTTargetX86
|
|||
|
||||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
|
||||
${LLVM_LIBRARY_DIR}/Target/X86
|
||||
${LLVM_BINARY_DIR}/lib/Target/X86
|
||||
)
|
||||
|
|
|
@ -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_LIBRARY_DIR}/Target/AArch64
|
||||
${LLVM_BINARY_DIR}/lib/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_LIBRARY_DIR}/Target/X86
|
||||
${LLVM_BINARY_DIR}/lib/Target/X86
|
||||
)
|
||||
|
||||
target_compile_definitions(CoreTests PRIVATE X86_AVAILABLE)
|
||||
|
|
|
@ -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_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
|
||||
get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
|
||||
export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
|
||||
|
|
|
@ -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_LIBRARY_DIR}/clang/${CLANG_VERSION}/include
|
||||
-I ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include
|
||||
-I ${CLANG_SOURCE_DIR}/include
|
||||
-I ${LLVM_BINARY_DIR}/tools/clang/include
|
||||
-I ${LLVM_BINARY_DIR}/include
|
||||
|
|
|
@ -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_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
|
||||
get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS)
|
||||
export(TARGETS ${FLANG_EXPORTS} FILE ${flang_cmake_builddir}/FlangTargets.cmake)
|
||||
|
|
|
@ -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_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
|
||||
get_property(LLD_EXPORTS GLOBAL PROPERTY LLD_EXPORTS)
|
||||
export(TARGETS ${LLD_EXPORTS} FILE ${lld_cmake_builddir}/LLDTargets.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_LIBRARY_DIR}")
|
||||
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
|
||||
# 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}")
|
||||
|
|
|
@ -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_TOOLS_BINARY_DIR}/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
|
||||
if (TARGET clang)
|
||||
set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_TOOLS_BINARY_DIR}/clang${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
set(LLDB_DEFAULT_TEST_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
else()
|
||||
set(LLDB_DEFAULT_TEST_COMPILER "")
|
||||
endif()
|
||||
|
|
|
@ -935,9 +935,9 @@ configure_file(
|
|||
)
|
||||
|
||||
# They are not referenced. See set_output_directory().
|
||||
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} )
|
||||
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} )
|
||||
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
include(GetErrcMessages)
|
||||
|
|
|
@ -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_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
file(WRITE
|
||||
"${llvm_cmake_builddir}/LLVMConfigExtensions.cmake"
|
||||
"set(LLVM_STATIC_EXTENSIONS ${LLVM_STATIC_EXTENSIONS})")
|
||||
|
|
|
@ -3,7 +3,7 @@ include(LLVMDistributionSupport)
|
|||
include(FindPrefixFromConfig)
|
||||
|
||||
# CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below.
|
||||
set(llvm_cmake_builddir "${LLVM_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
|
||||
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
|
||||
set(LLVM_EXPORTS_FILE ${llvm_cmake_builddir}/LLVMExports.cmake)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
|
||||
${LLVM_LIBRARY_DIR}/Target/AArch64
|
||||
${LLVM_BINARY_DIR}/lib/Target/AArch64
|
||||
)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/Mips
|
||||
${LLVM_LIBRARY_DIR}/Target/Mips
|
||||
${LLVM_BINARY_DIR}/lib/Target/Mips
|
||||
)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC
|
||||
${LLVM_LIBRARY_DIR}/Target/PowerPC
|
||||
${LLVM_BINARY_DIR}/lib/Target/PowerPC
|
||||
)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
|
||||
${LLVM_LIBRARY_DIR}/Target/X86
|
||||
${LLVM_BINARY_DIR}/lib/Target/X86
|
||||
)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
|
|
|
@ -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_LIBRARY_DIR})
|
||||
set(LIB_DIR ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
|
||||
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_LIBRARY_DIR}/${lib}.lib)
|
||||
list(APPEND FULL_LIB_NAMES ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${lib}.lib)
|
||||
endforeach()
|
||||
|
||||
# Need to separate lib names with newlines.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/ARM
|
||||
${LLVM_LIBRARY_DIR}/Target/ARM
|
||||
${LLVM_BINARY_DIR}/lib/Target/ARM
|
||||
)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include_directories(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/DirectX
|
||||
${LLVM_LIBRARY_DIR}/Target/DirectX
|
||||
${LLVM_BINARY_DIR}/lib/Target/DirectX
|
||||
)
|
||||
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_llvm_exegesis_unittest_includes(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/AArch64
|
||||
${LLVM_LIBRARY_DIR}/Target/AArch64
|
||||
${LLVM_BINARY_DIR}/lib/Target/AArch64
|
||||
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_llvm_exegesis_unittest_includes(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/ARM
|
||||
${LLVM_LIBRARY_DIR}/Target/ARM
|
||||
${LLVM_BINARY_DIR}/lib/Target/ARM
|
||||
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_llvm_exegesis_unittest_includes(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/Mips
|
||||
${LLVM_LIBRARY_DIR}/Target/Mips
|
||||
${LLVM_BINARY_DIR}/lib/Target/Mips
|
||||
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_llvm_exegesis_unittest_includes(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/PowerPC
|
||||
${LLVM_LIBRARY_DIR}/Target/PowerPC
|
||||
${LLVM_BINARY_DIR}/lib/Target/PowerPC
|
||||
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_llvm_exegesis_unittest_includes(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
|
||||
${LLVM_LIBRARY_DIR}/Target/X86
|
||||
${LLVM_BINARY_DIR}/lib/Target/X86
|
||||
${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_llvm_mca_unittest_includes(
|
||||
${LLVM_MAIN_SRC_DIR}/lib/Target/X86
|
||||
${LLVM_LIBRARY_DIR}/Target/X86
|
||||
${LLVM_BINARY_DIR}/lib/Target/X86
|
||||
)
|
||||
|
||||
add_llvm_mca_unittest_sources(
|
||||
|
|
|
@ -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_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
|
||||
get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS)
|
||||
export(TARGETS ${MLIR_EXPORTS} FILE ${mlir_cmake_builddir}/MLIRTargets.cmake)
|
||||
|
|
|
@ -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_LIBRARY_DIR}/cmake/llvm")
|
||||
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
|
||||
|
||||
if (CMAKE_CONFIGURATION_TYPES)
|
||||
set(POLLY_EXPORTS_FILE_NAME "PollyExports-$<LOWER_CASE:$<CONFIG>>.cmake")
|
||||
|
|
|
@ -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_LIBRARY_DIR}")
|
||||
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
|
||||
if (CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
set(POLLY_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
else()
|
||||
|
|
Loading…
Reference in New Issue