Index: bolt/CMakeLists.txt =================================================================== --- bolt/CMakeLists.txt +++ bolt/CMakeLists.txt @@ -55,7 +55,7 @@ -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_INSTALL_PREFIX=${LLVM_BINARY_DIR} - -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} + -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} BUILD_ALWAYS True ) install(CODE "execute_process\(COMMAND \${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/cmake_install.cmake \)" Index: bolt/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in =================================================================== --- bolt/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in +++ bolt/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in @@ -14,4 +14,4 @@ // //===----------------------------------------------------------------------===// -#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" +#define CMAKE_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" Index: bolt/lib/RuntimeLibs/RuntimeLibrary.cpp =================================================================== --- bolt/lib/RuntimeLibs/RuntimeLibrary.cpp +++ bolt/lib/RuntimeLibs/RuntimeLibrary.cpp @@ -29,12 +29,12 @@ StringRef LibFileName) { StringRef Dir = llvm::sys::path::parent_path(ToolPath); SmallString<128> LibPath = llvm::sys::path::parent_path(Dir); - llvm::sys::path::append(LibPath, "lib" LLVM_LIBDIR_SUFFIX); + llvm::sys::path::append(LibPath, CMAKE_INSTALL_LIBDIR); if (!llvm::sys::fs::exists(LibPath)) { // In some cases we install bolt binary into one level deeper in bin/, // we need to go back one more level to find lib directory. LibPath = llvm::sys::path::parent_path(llvm::sys::path::parent_path(Dir)); - llvm::sys::path::append(LibPath, "lib" LLVM_LIBDIR_SUFFIX); + llvm::sys::path::append(LibPath, CMAKE_INSTALL_LIBDIR); } llvm::sys::path::append(LibPath, LibFileName); if (!llvm::sys::fs::exists(LibPath)) { Index: bolt/runtime/CMakeLists.txt =================================================================== --- bolt/runtime/CMakeLists.txt +++ bolt/runtime/CMakeLists.txt @@ -15,12 +15,12 @@ instr.cpp ${CMAKE_CURRENT_BINARY_DIR}/config.h ) -set_target_properties(bolt_rt_instr PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}") +set_target_properties(bolt_rt_instr PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") add_library(bolt_rt_hugify STATIC hugify.cpp ${CMAKE_CURRENT_BINARY_DIR}/config.h ) -set_target_properties(bolt_rt_hugify PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}") +set_target_properties(bolt_rt_hugify PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") set(BOLT_RT_FLAGS -ffreestanding @@ -35,18 +35,18 @@ target_compile_options(bolt_rt_hugify PRIVATE ${BOLT_RT_FLAGS}) target_include_directories(bolt_rt_hugify PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -install(TARGETS bolt_rt_instr DESTINATION "lib${LLVM_LIBDIR_SUFFIX}") -install(TARGETS bolt_rt_hugify DESTINATION "lib${LLVM_LIBDIR_SUFFIX}") +install(TARGETS bolt_rt_instr DESTINATION "${CMAKE_INSTALL_LIBDIR}") +install(TARGETS bolt_rt_hugify DESTINATION "${CMAKE_INSTALL_LIBDIR}") if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*") add_library(bolt_rt_instr_osx STATIC instr.cpp ${CMAKE_CURRENT_BINARY_DIR}/config.h ) - set_target_properties(bolt_rt_instr_osx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}") + set_target_properties(bolt_rt_instr_osx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}") target_include_directories(bolt_rt_instr_osx PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_compile_options(bolt_rt_instr_osx PRIVATE -target x86_64-apple-darwin19.6.0 ${BOLT_RT_FLAGS}) - install(TARGETS bolt_rt_instr_osx DESTINATION "lib${LLVM_LIBDIR_SUFFIX}") + install(TARGETS bolt_rt_instr_osx DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() Index: clang/CMakeLists.txt =================================================================== --- clang/CMakeLists.txt +++ clang/CMakeLists.txt @@ -43,7 +43,7 @@ # They are used as destination of target generators. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}) if(WIN32 OR CYGWIN) # DLL platform -- put DLLs into bin. set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) @@ -78,8 +78,8 @@ link_directories("${LLVM_LIBRARY_DIR}") set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) - set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} ) - set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} ) + set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} ) + set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR} ) if(LLVM_INCLUDE_TESTS) find_package(Python3 ${LLVM_MINIMUM_PYTHON_VERSION} REQUIRED @@ -289,9 +289,6 @@ "LLVM_LINK_LLVM_DYLIB=OFF") endif() -# The libdir suffix must exactly match whatever LLVM's configuration used. -set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}") - set(CLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')") mark_as_advanced(CLANG_TOOLS_INSTALL_DIR) @@ -993,8 +990,6 @@ process_llvm_pass_plugins() endif() -set(CLANG_INSTALL_LIBDIR_BASENAME "lib${CLANG_LIBDIR_SUFFIX}") - configure_file( ${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake ${CLANG_BINARY_DIR}/include/clang/Config/config.h) Index: clang/cmake/caches/Android-stage2.cmake =================================================================== --- clang/cmake/caches/Android-stage2.cmake +++ clang/cmake/caches/Android-stage2.cmake @@ -4,7 +4,7 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "") set(LLVM_ENABLE_THREADS OFF CACHE BOOL "") set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") -set(LLVM_LIBDIR_SUFFIX 64 CACHE STRING "") +set(CMAKE_INSTALL_LIBDIR lib64 CACHE STRING "") set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") set(ANDROID_RUNTIMES_ENABLE_ASSERTIONS ON CACHE BOOL "") Index: clang/cmake/caches/Android.cmake =================================================================== --- clang/cmake/caches/Android.cmake +++ clang/cmake/caches/Android.cmake @@ -13,7 +13,7 @@ set(LLVM_BUILD_TOOLS OFF CACHE BOOL "") set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") set(LLVM_ENABLE_THREADS OFF CACHE BOOL "") -set(LLVM_LIBDIR_SUFFIX 64 CACHE STRING "") +set(CMAKE_INSTALL_LIBDIR lib64 CACHE STRING "") set(LLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD OFF CACHE BOOL "") set(LLVM_TOOL_OPENMP_BUILD OFF CACHE BOOL "") set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") Index: clang/cmake/modules/AddClang.cmake =================================================================== --- clang/cmake/modules/AddClang.cmake +++ clang/cmake/modules/AddClang.cmake @@ -119,8 +119,8 @@ install(TARGETS ${lib} COMPONENT ${lib} ${export_to_clangtargets} - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if (NOT LLVM_ENABLE_IDE) Index: clang/cmake/modules/CMakeLists.txt =================================================================== --- clang/cmake/modules/CMakeLists.txt +++ clang/cmake/modules/CMakeLists.txt @@ -9,7 +9,7 @@ set(CLANG_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/clang" CACHE STRING "Path for CMake subdirectory for Clang (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/clang')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang") +set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/clang") # Keep this in sync with llvm/cmake/CMakeLists.txt! set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING Index: clang/include/clang/Config/config.h.cmake =================================================================== --- clang/include/clang/Config/config.h.cmake +++ clang/include/clang/Config/config.h.cmake @@ -36,7 +36,7 @@ #define CLANG_SYSTEMZ_DEFAULT_ARCH "${CLANG_SYSTEMZ_DEFAULT_ARCH}" /* Multilib basename for libdir. */ -#define CLANG_INSTALL_LIBDIR_BASENAME "${CLANG_INSTALL_LIBDIR_BASENAME}" +#define CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}" /* Relative directory for resource files */ #define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}" Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ clang/lib/Driver/Driver.cpp @@ -181,7 +181,7 @@ // path of the embedding binary, which for LLVM binaries will be in bin/. // ../lib gets us to lib/ in both cases. P = llvm::sys::path::parent_path(Dir); - llvm::sys::path::append(P, CLANG_INSTALL_LIBDIR_BASENAME, "clang", + llvm::sys::path::append(P, CMAKE_INSTALL_LIBDIR, "clang", CLANG_VERSION_STRING); } Index: clang/lib/Driver/ToolChains/CommonArgs.cpp =================================================================== --- clang/lib/Driver/ToolChains/CommonArgs.cpp +++ clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -513,7 +513,7 @@ SmallString<1024> Plugin; llvm::sys::path::native(Twine(D.Dir) + - "/../" CLANG_INSTALL_LIBDIR_BASENAME + + "/../" CMAKE_INSTALL_LIBDIR + PluginName + Suffix, Plugin); CmdArgs.push_back(Args.MakeArgString(Twine(PluginPrefix) + Plugin)); @@ -719,7 +719,7 @@ // runtime SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(TC.getDriver().Dir); - llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); + llvm::sys::path::append(DefaultLibPath, CMAKE_INSTALL_LIBDIR); CmdArgs.push_back("-rpath"); CmdArgs.push_back(Args.MakeArgString(DefaultLibPath)); } @@ -732,7 +732,7 @@ // runtime. SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(TC.getDriver().Dir); - llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); + llvm::sys::path::append(DefaultLibPath, CMAKE_INSTALL_LIBDIR); CmdArgs.push_back(Args.MakeArgString("-L" + DefaultLibPath)); } @@ -2075,7 +2075,7 @@ // Add path to lib-debug folders SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir); - llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); + llvm::sys::path::append(DefaultLibPath, CMAKE_INSTALL_LIBDIR); LibraryPaths.emplace_back(DefaultLibPath.c_str()); // Build list of Static Device Libraries SDLs specified by -l option @@ -2222,7 +2222,7 @@ // Add path to clang lib / lib64 folder. SmallString<256> DefaultLibPath = llvm::sys::path::parent_path(D.Dir); - llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME); + llvm::sys::path::append(DefaultLibPath, CMAKE_INSTALL_LIBDIR); LibraryPaths.emplace_back(DefaultLibPath.c_str()); // Add user defined library paths from LIBRARY_PATH. Index: clang/lib/Headers/CMakeLists.txt =================================================================== --- clang/lib/Headers/CMakeLists.txt +++ clang/lib/Headers/CMakeLists.txt @@ -432,7 +432,7 @@ add_header_target("windows-resource-headers" ${windows_only_files}) add_header_target("utility-resource-headers" ${utility_files}) -set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) +set(header_install_dir ${CMAKE_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include) ############################################################# # Install rules for the catch-all clang-resource-headers target Index: clang/runtime/CMakeLists.txt =================================================================== --- clang/runtime/CMakeLists.txt +++ clang/runtime/CMakeLists.txt @@ -84,10 +84,10 @@ -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS} -DCOMPILER_RT_OUTPUT_DIR=${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION} -DCOMPILER_RT_EXEC_OUTPUT_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR} - -DCOMPILER_RT_INSTALL_PATH:PATH=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION} + -DCOMPILER_RT_INSTALL_PATH:PATH=${CMAKE_INSTALL_LIBDIR}/clang/${CLANG_VERSION} -DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} + -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_RUNTIME_OUTPUT_INTDIR} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT} Index: clang/tools/libclang/CMakeLists.txt =================================================================== --- clang/tools/libclang/CMakeLists.txt +++ clang/tools/libclang/CMakeLists.txt @@ -231,7 +231,7 @@ COMPONENT libclang-python-bindings DESTINATION - "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages") + "${CMAKE_INSTALL_LIBDIR}/python${PythonVersion}/site-packages") endforeach() if(NOT LLVM_ENABLE_IDE) add_custom_target(libclang-python-bindings) Index: clang/tools/scan-build-py/CMakeLists.txt =================================================================== --- clang/tools/scan-build-py/CMakeLists.txt +++ clang/tools/scan-build-py/CMakeLists.txt @@ -88,7 +88,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}) list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}) install(FILES lib/libscanbuild/${lib} - DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild + DESTINATION ${CMAKE_INSTALL_LIBDIR}/libscanbuild COMPONENT scan-build-py) endforeach() @@ -106,7 +106,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}) list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}) install(FILES lib/libscanbuild/resources/${resource} - DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libscanbuild/resources + DESTINATION ${CMAKE_INSTALL_LIBDIR}/libscanbuild/resources COMPONENT scan-build-py) endforeach() @@ -122,7 +122,7 @@ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}) list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib}) install(FILES lib/libear/${lib} - DESTINATION lib${CLANG_LIBDIR_SUFFIX}/libear + DESTINATION ${CMAKE_INSTALL_LIBDIR}/libear COMPONENT scan-build-py) endforeach() Index: cmake/Modules/GNUInstallPackageDir.cmake =================================================================== --- cmake/Modules/GNUInstallPackageDir.cmake +++ cmake/Modules/GNUInstallPackageDir.cmake @@ -29,5 +29,5 @@ _GNUInstallPackageDir_cache_convert_to_path("${var}" "${description}") endmacro() -_GNUInstallPackageDir_cache_path(CMAKE_INSTALL_PACKAGEDIR "lib${LLVM_LIBDIR_SUFFIX}/cmake" +_GNUInstallPackageDir_cache_path(CMAKE_INSTALL_PACKAGEDIR "${CMAKE_INSTALL_LIBDIR}/cmake" "Directories containing installed CMake modules (lib/cmake)") Index: compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake =================================================================== --- compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake +++ compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake @@ -62,7 +62,7 @@ # setting _install_rpath on AIX for reference. if(LLVM_LIBRARY_OUTPUT_INTDIR AND CMAKE_INSTALL_PREFIX) set(output_dir "${LLVM_LIBRARY_OUTPUT_INTDIR}") - set(install_dir "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}") + set(install_dir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") else() get_compiler_rt_output_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} output_dir) get_compiler_rt_install_dir(${COMPILER_RT_DEFAULT_TARGET_ARCH} install_dir) Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake =================================================================== --- compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -386,7 +386,7 @@ file(TO_CMAKE_PATH ${LLVM_CMAKE_DIR_FROM_LLVM_CONFIG} LLVM_CMAKE_DIR) else() file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE) - set(LLVM_CMAKE_DIR "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") + set(LLVM_CMAKE_DIR "${LLVM_BINARY_DIR_CMAKE_STYLE}/${CMAKE_INSTALL_LIBDIR}/cmake/llvm") endif() set(LLVM_CMAKE_INCLUDE_FILE "${LLVM_CMAKE_DIR}/LLVMConfig.cmake") @@ -402,7 +402,7 @@ unset(LLVM_CMAKE_INCLUDE_FILE) set(LLVM_LIBRARY_OUTPUT_INTDIR - ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) + ${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}) endif() # Finally set the cache variable now that `llvm-config` has also had a chance Index: compiler-rt/cmake/base-config-ix.cmake =================================================================== --- compiler-rt/cmake/base-config-ix.cmake +++ compiler-rt/cmake/base-config-ix.cmake @@ -45,7 +45,7 @@ # Setup the paths where compiler-rt runtimes and headers should be stored. set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}) set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) - set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}) + set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/clang/${CLANG_VERSION}) option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." ${LLVM_INCLUDE_TESTS}) option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" Index: compiler-rt/docs/BuildingCompilerRT.rst =================================================================== --- compiler-rt/docs/BuildingCompilerRT.rst +++ compiler-rt/docs/BuildingCompilerRT.rst @@ -79,14 +79,3 @@ Path where Compiler-RT data should be installed. If a relative path, relative to ``COMPILER_RT_INSTALL_PATH``. - -.. _LLVM-specific variables: - -LLVM-specific options ---------------------- - -.. option:: LLVM_LIBDIR_SUFFIX:STRING - - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` - to install libraries to ``/usr/lib64``. Index: flang/CMakeLists.txt =================================================================== --- flang/CMakeLists.txt +++ flang/CMakeLists.txt @@ -135,9 +135,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}}) set(LLVM_EXTERNAL_LIT "${LLVM_TOOLS_BINARY_DIR}/llvm-lit" CACHE STRING "Command used to spawn lit") Index: flang/cmake/modules/AddFlang.cmake =================================================================== --- flang/cmake/modules/AddFlang.cmake +++ flang/cmake/modules/AddFlang.cmake @@ -71,8 +71,8 @@ install(TARGETS ${name} COMPONENT ${name} ${export_to_flangtargets} - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if (NOT LLVM_ENABLE_IDE) Index: flang/cmake/modules/CMakeLists.txt =================================================================== --- flang/cmake/modules/CMakeLists.txt +++ flang/cmake/modules/CMakeLists.txt @@ -8,7 +8,7 @@ set(FLANG_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/flang" CACHE STRING "Path for CMake subdirectory for Flang (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/flang')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(flang_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/flang") +set(flang_cmake_builddir "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}}/cmake/flang") # Keep this in sync with llvm/cmake/CMakeLists.txt! set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING Index: libc/lib/CMakeLists.txt =================================================================== --- libc/lib/CMakeLists.txt +++ libc/lib/CMakeLists.txt @@ -10,9 +10,9 @@ ) if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR) - set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}) + set(LIBC_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}}/${LLVM_DEFAULT_TARGET_TRIPLE}) else() - set(LIBC_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}) + set(LIBC_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}}) endif() install( Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -151,8 +151,6 @@ endif() option(LIBCXX_INCLUDE_DOCS "Build the libc++ documentation." ${LLVM_INCLUDE_DOCS}) -set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING - "Define suffix of library directory name (32/64)") option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON) cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY @@ -414,7 +412,7 @@ set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1") - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH + set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH "Path where built libc++ libraries should be installed.") set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH "Path where target-specific libc++ headers should be installed.") @@ -427,12 +425,10 @@ set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") else() - set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1") endif() set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_GENERATED_INCLUDE_DIR}") - set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX} CACHE PATH - "Path where built libc++ libraries should be installed.") set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${LIBCXX_INSTALL_INCLUDE_DIR}" CACHE PATH "Path where target-specific libc++ headers should be installed.") endif() Index: libcxx/docs/BuildingLibcxx.rst =================================================================== --- libcxx/docs/BuildingLibcxx.rst +++ libcxx/docs/BuildingLibcxx.rst @@ -234,11 +234,6 @@ Build libc++ as a static library. Either `LIBCXX_ENABLE_SHARED` or `LIBCXX_ENABLE_STATIC` has to be enabled. -.. option:: LIBCXX_LIBDIR_SUFFIX:STRING - - Extra suffix to append to the directory where libraries are to be installed. - This option overrides `LLVM_LIBDIR_SUFFIX`. - .. option:: LIBCXX_HERMETIC_STATIC_LIBRARY:BOOL **Default**: ``OFF`` @@ -266,7 +261,7 @@ .. option:: LIBCXX_INSTALL_LIBRARY_DIR:PATH - **Default**: ``lib${LIBCXX_LIBDIR_SUFFIX}`` + **Default**: ``${CMAKE_INSTALL_LIBDIR}`` Path where built libc++ libraries should be installed. If a relative path, relative to ``CMAKE_INSTALL_PREFIX``. @@ -459,12 +454,6 @@ LLVM-specific options --------------------- -.. option:: LLVM_LIBDIR_SUFFIX:STRING - - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` - to install libraries to ``/usr/lib64``. - .. option:: LLVM_BUILD_32_BITS:BOOL Build 32-bits executables and libraries on 64-bits systems. This option is Index: libcxxabi/CMakeLists.txt =================================================================== --- libcxxabi/CMakeLists.txt +++ libcxxabi/CMakeLists.txt @@ -74,8 +74,6 @@ endif() option(LIBCXXABI_INCLUDE_TESTS "Generate build targets for the libc++abi unit tests." ${LLVM_INCLUDE_TESTS}) -set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING - "Define suffix of library directory name (32/64)") option(LIBCXXABI_INSTALL_HEADERS "Install the libc++abi headers." ON) option(LIBCXXABI_INSTALL_LIBRARY "Install the libc++abi library." ON) @@ -190,7 +188,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) set(LIBCXXABI_HEADER_DIR ${LLVM_BINARY_DIR}) set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH "Path where built libc++abi libraries should be installed.") if(LIBCXX_LIBDIR_SUBDIR) string(APPEND LIBCXXABI_LIBRARY_DIR /${LIBCXXABI_LIBDIR_SUBDIR}) @@ -202,9 +200,9 @@ set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) else() set(LIBCXXABI_HEADER_DIR ${CMAKE_BINARY_DIR}) - set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) + set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) endif() - set(LIBCXXABI_INSTALL_LIBRARY_DIR lib${LIBCXXABI_LIBDIR_SUFFIX} CACHE PATH + set(LIBCXXABI_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Path where built libc++abi libraries should be installed.") endif() Index: libunwind/CMakeLists.txt =================================================================== --- libunwind/CMakeLists.txt +++ libunwind/CMakeLists.txt @@ -51,8 +51,6 @@ option(LIBUNWIND_REMEMBER_HEAP_ALLOC "Use heap instead of the stack for .cfi_remember_state." OFF) option(LIBUNWIND_INSTALL_HEADERS "Install the libunwind headers." ON) -set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING - "Define suffix of library directory name (32/64)") option(LIBUNWIND_INSTALL_LIBRARY "Install the libunwind library." ON) cmake_dependent_option(LIBUNWIND_INSTALL_STATIC_LIBRARY "Install the static libunwind library." ON @@ -116,7 +114,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}) - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH "Path where built libunwind libraries should be installed.") if(LIBCXX_LIBDIR_SUBDIR) string(APPEND LIBUNWIND_LIBRARY_DIR /${LIBUNWIND_LIBDIR_SUBDIR}) @@ -126,9 +124,9 @@ if(LLVM_LIBRARY_OUTPUT_INTDIR) set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) else() - set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}}) endif() - set(LIBUNWIND_INSTALL_LIBRARY_DIR lib${LIBUNWIND_LIBDIR_SUFFIX} CACHE PATH + set(LIBUNWIND_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}} CACHE PATH "Path where built libunwind libraries should be installed.") endif() Index: libunwind/docs/BuildingLibunwind.rst =================================================================== --- libunwind/docs/BuildingLibunwind.rst +++ libunwind/docs/BuildingLibunwind.rst @@ -144,7 +144,7 @@ .. option:: LIBUNWIND_INSTALL_LIBRARY_DIR:PATH - **Default**: ``lib${LIBUNWIND_LIBDIR_SUFFIX}`` + **Default**: ``${CMAKE_INSTALL_LIBDIR}`` Path where built libunwind libraries should be installed. If a relative path, relative to ``CMAKE_INSTALL_PREFIX``. Index: lld/CMakeLists.txt =================================================================== --- lld/CMakeLists.txt +++ lld/CMakeLists.txt @@ -36,7 +36,7 @@ # They are used as destination of target generators. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}) include(AddLLVM) include(TableGen) Index: lld/cmake/modules/AddLLD.cmake =================================================================== --- lld/cmake/modules/AddLLD.cmake +++ lld/cmake/modules/AddLLD.cmake @@ -18,8 +18,8 @@ install(TARGETS ${name} COMPONENT ${name} ${export_to_lldtargets} - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) Index: lld/cmake/modules/CMakeLists.txt =================================================================== --- lld/cmake/modules/CMakeLists.txt +++ lld/cmake/modules/CMakeLists.txt @@ -8,7 +8,7 @@ set(LLD_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/lld" CACHE STRING "Path for CMake subdirectory for LLD (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/lld')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(lld_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/lld") +set(lld_cmake_builddir "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/lld") # Keep this in sync with llvm/cmake/CMakeLists.txt! set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING Index: lldb/cmake/modules/AddLLDB.cmake =================================================================== --- lldb/cmake/modules/AddLLDB.cmake +++ lldb/cmake/modules/AddLLDB.cmake @@ -109,7 +109,7 @@ endif() if(PARAM_SHARED) - set(install_dest lib${LLVM_LIBDIR_SUFFIX}) + set(install_dest ${CMAKE_INSTALL_LIBDIR}) if(PARAM_INSTALL_PREFIX) set(install_dest ${PARAM_INSTALL_PREFIX}) endif() Index: lldb/cmake/modules/LLDBGenerateConfig.cmake =================================================================== --- lldb/cmake/modules/LLDBGenerateConfig.cmake +++ lldb/cmake/modules/LLDBGenerateConfig.cmake @@ -19,7 +19,7 @@ check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION) -set(LLDB_INSTALL_LIBDIR_BASENAME "lib${LLDB_LIBDIR_SUFFIX}") +set(LLDB_INSTALL_LIBDIR_BASENAME "${CMAKE_INSTALL_LIBDIR}") # These checks exist in LLVM's configuration, so I want to match the LLVM names # so that the check isn't duplicated, but we translate them into the LLDB names Index: lldb/cmake/modules/LLDBStandalone.cmake =================================================================== --- lldb/cmake/modules/LLDBStandalone.cmake +++ lldb/cmake/modules/LLDBStandalone.cmake @@ -70,7 +70,7 @@ # They are used as destination of target generators. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) -set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}) if(WIN32 OR CYGWIN) # DLL platform -- put DLLs into bin. set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) @@ -124,5 +124,5 @@ endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) Index: lldb/source/API/CMakeLists.txt =================================================================== --- lldb/source/API/CMakeLists.txt +++ lldb/source/API/CMakeLists.txt @@ -114,7 +114,7 @@ # (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so # that _lldb.so can be loaded from Python. if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB) AND UNIX AND NOT APPLE) - set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}") + set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "\$ORIGIN/../../../../${CMAKE_INSTALL_LIBDIR}") endif() if(Python3_RPATH) Index: lldb/test/CMakeLists.txt =================================================================== --- lldb/test/CMakeLists.txt +++ lldb/test/CMakeLists.txt @@ -102,7 +102,7 @@ set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1") else() - set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${LIBCXX_INSTALL_LIBDIR}) set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1") endif() add_lldb_test_dependency(cxx) Index: lldb/tools/intel-features/CMakeLists.txt =================================================================== --- lldb/tools/intel-features/CMakeLists.txt +++ lldb/tools/intel-features/CMakeLists.txt @@ -30,4 +30,4 @@ ) install(TARGETS lldbIntelFeatures - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) Index: lldb/utils/lldb-dotest/CMakeLists.txt =================================================================== --- lldb/utils/lldb-dotest/CMakeLists.txt +++ lldb/utils/lldb-dotest/CMakeLists.txt @@ -19,7 +19,7 @@ set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1") set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1") else() - set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/${LIBCXX_INSTALL_LIBDIR}) set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1") endif() endif() Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -48,14 +48,6 @@ VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH} LANGUAGES C CXX ASM) -if (NOT DEFINED CMAKE_INSTALL_LIBDIR AND DEFINED LLVM_LIBDIR_SUFFIX) - # Must go before `include(GNUInstallDirs)`. - set(CMAKE_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") -endif() - -# Must go after `DEFINED LLVM_LIBDIR_SUFFIX` check. -set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" ) - # Must go after `project(..)`. include(GNUInstallDirs) @@ -386,7 +378,7 @@ # They are used as destination of target generators. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) -set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) +set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_INSTALL_LIBDIR}) if(WIN32 OR CYGWIN) # DLL platform -- put DLLs into bin. set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) @@ -1018,7 +1010,7 @@ add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime) install(TARGETS tf_xla_runtime EXPORT LLVMExports - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime) + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT tf_xla_runtime) set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime) # Once we add more modules, we should handle this more automatically. if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL) Index: llvm/cmake/modules/AddLLVM.cmake =================================================================== --- llvm/cmake/modules/AddLLVM.cmake +++ llvm/cmake/modules/AddLLVM.cmake @@ -867,8 +867,8 @@ get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) install(TARGETS ${name} ${export_to_llvmexports} - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT ${name} + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT ${name} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name}) if (NOT LLVM_ENABLE_IDE) @@ -2036,7 +2036,7 @@ set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX}) set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX}) - set(output_dir lib${LLVM_LIBDIR_SUFFIX}) + set(output_dir "${CMAKE_INSTALL_LIBDIR}") if(WIN32 AND "${type}" STREQUAL "SHARED") set(output_dir "${CMAKE_INSTALL_BINDIR}") endif() @@ -2305,15 +2305,15 @@ if (APPLE) set(_install_name_dir INSTALL_NAME_DIR "@rpath") - set(_install_rpath "@loader_path/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND BUILD_SHARED_LIBS) # $ORIGIN is not interpreted at link time by aix ld. # Since BUILD_SHARED_LIBS is only recommended for use by developers, # hardcode the rpath to build/install lib dir first in this mode. # FIXME: update this when there is better solution. - set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) elseif(UNIX) - set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir}) + set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir}) if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)") set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-z,origin ") Index: llvm/cmake/modules/AddOCaml.cmake =================================================================== --- llvm/cmake/modules/AddOCaml.cmake +++ llvm/cmake/modules/AddOCaml.cmake @@ -147,9 +147,9 @@ endforeach() if( APPLE ) - set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}") + set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}") elseif( UNIX ) - set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}") + set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}") endif() list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}") Index: llvm/cmake/modules/CMakeLists.txt =================================================================== --- llvm/cmake/modules/CMakeLists.txt +++ llvm/cmake/modules/CMakeLists.txt @@ -125,7 +125,7 @@ ) list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS) -extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "lib\${LLVM_LIBDIR_SUFFIX}") +extend_path(LLVM_CONFIG_LIBRARY_DIR "\${LLVM_INSTALL_PREFIX}" "\${CMAKE_INSTALL_LIBDIR}") set(LLVM_CONFIG_LIBRARY_DIRS "${LLVM_CONFIG_LIBRARY_DIR}" # FIXME: Should there be other entries here? Index: llvm/cmake/modules/LLVMConfig.cmake.in =================================================================== --- llvm/cmake/modules/LLVMConfig.cmake.in +++ llvm/cmake/modules/LLVMConfig.cmake.in @@ -103,7 +103,7 @@ set(LLVM_ON_UNIX @LLVM_ON_UNIX@) -set(LLVM_LIBDIR_SUFFIX @LLVM_LIBDIR_SUFFIX@) +set(CMAKE_INSTALL_LIBDIR @CMAKE_INSTALL_LIBDIR@) set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@") set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@") Index: llvm/docs/CMake.rst =================================================================== --- llvm/docs/CMake.rst +++ llvm/docs/CMake.rst @@ -247,11 +247,6 @@ Control which runtimes are enabled. For example you may want to work on libc++ or libc++abi by specifying ``-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"``. -**LLVM_LIBDIR_SUFFIX**:STRING - Extra suffix to append to the directory where libraries are to be - installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64`` - to install libraries to ``/usr/lib64``. - **LLVM_PARALLEL_{COMPILE,LINK}_JOBS**:STRING Building the llvm toolchain can use a lot of resources, particularly linking. These options, when you use the Ninja generator, allow you Index: llvm/docs/ReleaseNotes.rst =================================================================== --- llvm/docs/ReleaseNotes.rst +++ llvm/docs/ReleaseNotes.rst @@ -75,6 +75,10 @@ Changes to building LLVM ------------------------ +* ``LLVM_LIBDIR_SUFFIX`` is no longer supported. Instead one can use the + standard ``CMAKE_INSTALL_LIBDIR`` to customize the installation directory for + libraries. + Changes to TableGen ------------------- Index: llvm/tools/llvm-config/BuildVariables.inc.in =================================================================== --- llvm/tools/llvm-config/BuildVariables.inc.in +++ llvm/tools/llvm-config/BuildVariables.inc.in @@ -22,7 +22,7 @@ #define LLVM_LDFLAGS "@LLVM_LDFLAGS@" #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" -#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@" +#define CMAKE_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@" #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@" #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@" #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" Index: llvm/tools/llvm-config/llvm-config.cpp =================================================================== --- llvm/tools/llvm-config/llvm-config.cpp +++ llvm/tools/llvm-config/llvm-config.cpp @@ -337,7 +337,7 @@ switch (DevelopmentTreeLayout) { case CMakeStyle: ActiveBinDir = ActiveObjRoot + "/bin"; - ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveLibDir = ActiveObjRoot + "/" + CMAKE_INSTALL_LIBDIR; ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; break; case CMakeBuildModeStyle: @@ -345,10 +345,10 @@ ActivePrefix = ActiveObjRoot; ActiveBinDir = ActiveObjRoot + "/" + build_mode + "/bin"; ActiveLibDir = - ActiveObjRoot + "/" + build_mode + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveObjRoot + "/" + build_mode + "/" + CMAKE_INSTALL_LIBDIR; // The CMake directory isn't separated by build mode. ActiveCMakeDir = - ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX + "/cmake/llvm"; + ActivePrefix + "/" + CMAKE_INSTALL_LIBDIR + "/cmake/llvm"; break; } @@ -367,7 +367,7 @@ sys::fs::make_absolute(ActivePrefix, Path); ActiveBinDir = std::string(Path.str()); } - ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; + ActiveLibDir = ActivePrefix + "/" + CMAKE_INSTALL_LIBDIR; { SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); sys::fs::make_absolute(ActivePrefix, Path); Index: llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn +++ llvm/utils/gn/secondary/llvm/tools/llvm-config/BUILD.gn @@ -81,7 +81,6 @@ "LLVM_LDFLAGS=.", # FIXME "LLVM_CXXFLAGS=.", # FIXME "LLVM_BUILDMODE=$build_mode", - "LLVM_LIBDIR_SUFFIX=", "LLVM_TARGETS_BUILT=$llvm_targets_to_build_string", "LLVM_SYSTEM_LIBS=$system_libs", "LLVM_BUILD_SYSTEM=gn", Index: mlir/CMakeLists.txt =================================================================== --- mlir/CMakeLists.txt +++ mlir/CMakeLists.txt @@ -33,7 +33,7 @@ endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY - "${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}") + "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") set(LLVM_LIT_ARGS "-sv" CACHE STRING "Default options for lit") Index: mlir/cmake/modules/AddMLIR.cmake =================================================================== --- mlir/cmake/modules/AddMLIR.cmake +++ mlir/cmake/modules/AddMLIR.cmake @@ -533,13 +533,13 @@ install(TARGETS ${name} COMPONENT ${name} ${export_to_mlirtargets} - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" # Note that CMake will create a directory like: # objects-${CMAKE_BUILD_TYPE}/obj.LibName # and put object files there. - OBJECTS DESTINATION lib${LLVM_LIBDIR_SUFFIX} + OBJECTS DESTINATION ${CMAKE_INSTALL_LIBDIR} ) if (NOT LLVM_ENABLE_IDE) Index: mlir/cmake/modules/AddMLIRPython.cmake =================================================================== --- mlir/cmake/modules/AddMLIRPython.cmake +++ mlir/cmake/modules/AddMLIRPython.cmake @@ -409,7 +409,7 @@ set_property(TARGET ${target} APPEND PROPERTY BUILD_RPATH "${_real_lib_dir}") set_property(TARGET ${target} APPEND PROPERTY - INSTALL_RPATH "${_origin_prefix}/${ARG_RELATIVE_INSTALL_ROOT}/lib${LLVM_LIBDIR_SUFFIX}") + INSTALL_RPATH "${_origin_prefix}/${ARG_RELATIVE_INSTALL_ROOT}/${CMAKE_INSTALL_LIBDIR}") endif() endfunction() Index: mlir/cmake/modules/CMakeLists.txt =================================================================== --- mlir/cmake/modules/CMakeLists.txt +++ mlir/cmake/modules/CMakeLists.txt @@ -9,7 +9,7 @@ set(MLIR_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/mlir" CACHE STRING "Path for CMake subdirectory for Polly (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/polly')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(mlir_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir") +set(mlir_cmake_builddir "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/mlir") # Keep this in sync with llvm/cmake/CMakeLists.txt! set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING Index: mlir/test/CMakeLists.txt =================================================================== --- mlir/test/CMakeLists.txt +++ mlir/test/CMakeLists.txt @@ -8,7 +8,7 @@ # Provide the MLIR CMake module dir so that the out of tree Standalone # dialect and can add it to the module path. set(MLIR_CMAKE_DIR - "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir") + "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/mlir") # Passed to lit.site.cfg.py.in to set up the path where to find libraries. set(MLIR_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) Index: openmp/CMakeLists.txt =================================================================== --- openmp/CMakeLists.txt +++ openmp/CMakeLists.txt @@ -26,10 +26,6 @@ # Group common settings. set(OPENMP_ENABLE_WERROR FALSE CACHE BOOL "Enable -Werror flags to turn warnings into errors for supporting compilers.") - set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING - "Suffix of lib installation directory, e.g. 64 => lib64") - # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR. - set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}") # Group test settings. set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING @@ -39,8 +35,6 @@ set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.") else() set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR}) - # If building in tree, we honor the same install suffix LLVM uses. - set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}") if (NOT MSVC) set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) @@ -80,7 +74,7 @@ set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}") else() string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION}) - set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include") + set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include") endif() # Build host runtime library, after LIBOMPTARGET variables are set since they are needed Index: openmp/README.rst =================================================================== --- openmp/README.rst +++ openmp/README.rst @@ -108,9 +108,6 @@ **OPENMP_ENABLE_WERROR** = ``OFF|ON`` Treat warnings as errors and fail, if a compiler warning is triggered. -**OPENMP_LIBDIR_SUFFIX** = ``""`` - Extra suffix to append to the directory where libraries are to be installed. - **OPENMP_TEST_C_COMPILER** = ``${CMAKE_C_COMPILER}`` Compiler to use for testing. Defaults to the compiler that was also used for building. Index: openmp/libompd/src/CMakeLists.txt =================================================================== --- openmp/libompd/src/CMakeLists.txt +++ openmp/libompd/src/CMakeLists.txt @@ -45,6 +45,6 @@ ) INSTALL( TARGETS ompd - LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ) Index: openmp/libomptarget/DeviceRTL/CMakeLists.txt =================================================================== --- openmp/libomptarget/DeviceRTL/CMakeLists.txt +++ openmp/libomptarget/DeviceRTL/CMakeLists.txt @@ -219,7 +219,7 @@ set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${bclib_name} ${LIBOMPTARGET_LIBRARY_DIR}/${bclib_name}) # Install bitcode library under the lib destination folder. - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} DESTINATION "${OPENMP_INSTALL_LIBDIR}") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} DESTINATION "${CMAKE_INSTALL_LIBDIR}") add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/extracted_${bclib_name} COMMAND ${EXTRACT_TOOL} ${link_extract_flag} ${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} @@ -282,4 +282,4 @@ set_target_properties(omptarget.devicertl PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries(omptarget.devicertl PRIVATE omptarget.devicertl.all_objs) -install(TARGETS omptarget.devicertl ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}) +install(TARGETS omptarget.devicertl ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) Index: openmp/libomptarget/plugins-nextgen/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins-nextgen/CMakeLists.txt +++ openmp/libomptarget/plugins-nextgen/CMakeLists.txt @@ -56,7 +56,7 @@ # Install plugin under the lib destination folder. install(TARGETS "omptarget.rtl.${tmachine_libname}.nextgen" - LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") set_target_properties("omptarget.rtl.${tmachine_libname}.nextgen" PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.." CXX_VISIBILITY_PRESET protected) Index: openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt +++ openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt @@ -88,7 +88,7 @@ add_dependencies(omptarget.rtl.cuda.nextgen omptarget.devicertl.nvptx) # Install plugin under the lib destination folder. -install(TARGETS omptarget.rtl.cuda.nextgen LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") +install(TARGETS omptarget.rtl.cuda.nextgen LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") set_target_properties(omptarget.rtl.cuda.nextgen PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.." CXX_VISIBILITY_PRESET protected) Index: openmp/libomptarget/plugins/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins/CMakeLists.txt +++ openmp/libomptarget/plugins/CMakeLists.txt @@ -50,7 +50,7 @@ # Install plugin under the lib destination folder. install(TARGETS "omptarget.rtl.${tmachine_libname}" - LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") set_target_properties("omptarget.rtl.${tmachine_libname}" PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.." CXX_VISIBILITY_PRESET protected) Index: openmp/libomptarget/plugins/amdgpu/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins/amdgpu/CMakeLists.txt +++ openmp/libomptarget/plugins/amdgpu/CMakeLists.txt @@ -100,7 +100,7 @@ # Install plugin under the lib destination folder. -install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") +install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") set_target_properties(omptarget.rtl.amdgpu PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.." CXX_VISIBILITY_PRESET protected) Index: openmp/libomptarget/plugins/cuda/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins/cuda/CMakeLists.txt +++ openmp/libomptarget/plugins/cuda/CMakeLists.txt @@ -85,7 +85,7 @@ add_dependencies(omptarget.rtl.cuda omptarget.devicertl.nvptx) # Install plugin under the lib destination folder. -install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") +install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") set_target_properties(omptarget.rtl.cuda PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.." CXX_VISIBILITY_PRESET protected) Index: openmp/libomptarget/plugins/remote/src/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins/remote/src/CMakeLists.txt +++ openmp/libomptarget/plugins/remote/src/CMakeLists.txt @@ -29,7 +29,7 @@ ) # Install plugin under the lib destination folder. -install(TARGETS omptarget.rtl.rpc LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") +install(TARGETS omptarget.rtl.rpc LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") target_link_libraries(omptarget.rtl.rpc grpc++ Index: openmp/libomptarget/plugins/ve/CMakeLists.txt =================================================================== --- openmp/libomptarget/plugins/ve/CMakeLists.txt +++ openmp/libomptarget/plugins/ve/CMakeLists.txt @@ -42,7 +42,7 @@ ) # Install plugin under the lib destination folder. - install(TARGETS "omptarget.rtl.${tmachine_libname}" LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") + install(TARGETS "omptarget.rtl.${tmachine_libname}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") set_target_properties("omptarget.rtl.${tmachine_libname}" PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.." CXX_VISIBILITY_PRESET protected) Index: openmp/libomptarget/src/CMakeLists.txt =================================================================== --- openmp/libomptarget/src/CMakeLists.txt +++ openmp/libomptarget/src/CMakeLists.txt @@ -40,4 +40,4 @@ # libomptarget.so needs to be aware of where the plugins live as they # are now separated in the build directory. set_target_properties(omptarget PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..") -install(TARGETS omptarget LIBRARY COMPONENT omptarget DESTINATION "${OPENMP_INSTALL_LIBDIR}") +install(TARGETS omptarget LIBRARY COMPONENT omptarget DESTINATION "${CMAKE_INSTALL_LIBDIR}") Index: openmp/runtime/src/CMakeLists.txt =================================================================== --- openmp/runtime/src/CMakeLists.txt +++ openmp/runtime/src/CMakeLists.txt @@ -357,25 +357,25 @@ # We want to install headers in ${DESTDIR}/${CMAKE_INSTALL_FULL_INCLUDEDIR} if(WIN32) install(TARGETS omp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") - install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") + install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") # Create aliases (regular copies) of the library for backwards compatibility set(LIBOMP_ALIASES "libiomp5md") foreach(alias IN LISTS LIBOMP_ALIASES) install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\" \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${CMAKE_INSTALL_FULL_BINDIR}\")") - extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}") + extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}") install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\" \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"${outdir}\")") endforeach() else() - install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION "${OPENMP_INSTALL_LIBDIR}") + install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION "${CMAKE_INSTALL_LIBDIR}") if(${LIBOMP_INSTALL_ALIASES}) # Create aliases (symlinks) of the library for backwards compatibility set(LIBOMP_ALIASES "libgomp;libiomp5") foreach(alias IN LISTS LIBOMP_ALIASES) - extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${OPENMP_INSTALL_LIBDIR}") + extend_path(outdir "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}") install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\" \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\$ENV{DESTDIR}${outdir}\")") Index: openmp/tools/Modules/CMakeLists.txt =================================================================== --- openmp/tools/Modules/CMakeLists.txt +++ openmp/tools/Modules/CMakeLists.txt @@ -12,4 +12,4 @@ install(FILES "FindOpenMPTarget.cmake" - DESTINATION "${OPENMP_INSTALL_LIBDIR}/cmake/openmp") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/openmp") Index: openmp/tools/archer/CMakeLists.txt =================================================================== --- openmp/tools/archer/CMakeLists.txt +++ openmp/tools/archer/CMakeLists.txt @@ -15,8 +15,8 @@ add_library(archer_static STATIC ompt-tsan.cpp) install(TARGETS archer archer_static - LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) add_subdirectory(tests) endif() Index: polly/cmake/CMakeLists.txt =================================================================== --- polly/cmake/CMakeLists.txt +++ polly/cmake/CMakeLists.txt @@ -7,7 +7,7 @@ set(POLLY_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/polly" CACHE STRING "Path for CMake subdirectory for Polly (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/polly')") # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below. -set(polly_cmake_builddir "${POLLY_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/polly") +set(polly_cmake_builddir "${POLLY_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/polly") set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')") @@ -93,7 +93,7 @@ find_prefix_from_config(POLLY_CONFIG_CODE POLLY_INSTALL_PREFIX "${POLLY_INSTALL_PACKAGE_DIR}") extend_path(POLLY_CONFIG_LLVM_CMAKE_DIR "\${POLLY_INSTALL_PREFIX}" "${LLVM_INSTALL_PACKAGE_DIR}") extend_path(POLLY_CONFIG_CMAKE_DIR "\${POLLY_INSTALL_PREFIX}" "${POLLY_INSTALL_PACKAGE_DIR}") -extend_path(POLLY_CONFIG_LIBRARY_DIRS "\${POLLY_INSTALL_PREFIX}" "lib${LLVM_LIBDIR_SUFFIX}") +extend_path(POLLY_CONFIG_LIBRARY_DIRS "\${POLLY_INSTALL_PREFIX}" "${CMAKE_INSTALL_LIBDIR}") extend_path(base_includedir "\${POLLY_INSTALL_PREFIX}" "${CMAKE_INSTALL_INCLUDEDIR}") if (POLLY_BUNDLED_ISL) set(POLLY_CONFIG_INCLUDE_DIRS Index: polly/cmake/polly_macros.cmake =================================================================== --- polly/cmake/polly_macros.cmake +++ polly/cmake/polly_macros.cmake @@ -44,8 +44,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly") install(TARGETS ${name} EXPORT LLVMExports - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) endmacro(add_polly_library)