[cmake/multilib] Teach LLDB to respect the multlib LLVM_LIBDIR_SUFFIX
authorChandler Carruth <chandlerc@gmail.com>
Mon, 29 Dec 2014 12:42:33 +0000 (12:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 29 Dec 2014 12:42:33 +0000 (12:42 +0000)
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
lldb/docs/CMakeLists.txt
lldb/scripts/Python/modules/readline/CMakeLists.txt
lldb/source/CMakeLists.txt

index 39164a1..22e39ff 100644 (file)
@@ -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()
index efc781e..045e816 100644 (file)
@@ -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)
index e0613a3..2e1afa1 100644 (file)
@@ -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})
index d551ebb..8c2ea91 100644 (file)
@@ -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})