From 875d3bb5386380ae9aa1a0d467fea0cdefb04f89 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 29 Dec 2014 12:42:33 +0000 Subject: [PATCH] [cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIX variable (now provided both by the normal parent LLVM CMake files and by the LLVMConfig.cmake file used by the standalone build). This allows LLDB to build into and install into correctly suffixed libdirs. This is especially significant for LLDB because the python extension building done by CMake directly uses multilib suffixes when the host OS does, and the host OS will not always look back and forth between them. As a consequence, before LLVM, Clang, and LLDB (and every other subproject) had support for using LLVM_LIBDIR_SUFFIX, you couldn't build or install LLDB on a multilib system with its python extensions enabled. With this patch (on top of all the others I have submitted throughout the project), I'm finally able to build and install LLDB on my system with Python support enabled. I'm also able to actually run the LLDB test suite, etc. Now, a *huge* number of the tests still fail on my Linux system, but hey, actually running them and them testing the debugger is a huge step forward. =D llvm-svn: 224930 --- lldb/CMakeLists.txt | 10 +++++----- lldb/docs/CMakeLists.txt | 2 +- lldb/scripts/Python/modules/readline/CMakeLists.txt | 4 ++-- lldb/source/CMakeLists.txt | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 39164a10659e..22e39ff20985 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -66,7 +66,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) # These variables are used by add_llvm_library. set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) include(AddLLVM) include(HandleLLVMOptions) @@ -98,12 +98,12 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) "${PATH_TO_CLANG_BUILD}/include" "${CLANG_MAIN_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/source") - link_directories("${PATH_TO_LLVM_BUILD}/lib" - "${PATH_TO_CLANG_BUILD}/lib") + link_directories("${PATH_TO_LLVM_BUILD}/lib${LLVM_LIBDIR_SUFFIX}" + "${PATH_TO_CLANG_BUILD}/lib${LLVM_LIBDIR_SUFFIX}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + 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(LLDB_BUILT_STANDALONE 1) endif() diff --git a/lldb/docs/CMakeLists.txt b/lldb/docs/CMakeLists.txt index efc781e87e98..045e816b727c 100644 --- a/lldb/docs/CMakeLists.txt +++ b/lldb/docs/CMakeLists.txt @@ -35,7 +35,7 @@ if(EPYDOC_EXECUTABLE) --url "http://lldb.llvm.org" ${EPYDOC_OPTIONS} DEPENDS swig_wrapper liblldb - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/python2.7/site-packages + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../../lib${LLVM_LIBDIR_SUFFIX}/python2.7/site-packages COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM ) endif(EPYDOC_EXECUTABLE) diff --git a/lldb/scripts/Python/modules/readline/CMakeLists.txt b/lldb/scripts/Python/modules/readline/CMakeLists.txt index e0613a32b4fd..2e1afa1f73bb 100644 --- a/lldb/scripts/Python/modules/readline/CMakeLists.txt +++ b/lldb/scripts/Python/modules/readline/CMakeLists.txt @@ -13,7 +13,7 @@ add_library(readline SHARED readline.cpp) # python finds it when loading the python readline module. set_target_properties(readline PROPERTIES PREFIX "" - LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib/${PYTHON_DIRECTORY}) + LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/${PYTHON_DIRECTORY}) # Install the readline module. -install(TARGETS readline LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${PYTHON_DIRECTORY}) +install(TARGETS readline LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/${PYTHON_DIRECTORY}) diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index d551ebbe6888..8c2ea91ef31b 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -184,5 +184,5 @@ endif () install(TARGETS liblldb RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} + ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})