From 7ec1a56baf4d2f30abf525a851971f671ec04d93 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Tue, 8 Aug 2017 00:37:59 +0000 Subject: [PATCH] [CMake] Allow overriding lib dir suffix independently from LLVM This matches the options already supported by libc++ and libc++abi. Differential Revision: https://reviews.llvm.org/D36383 llvm-svn: 310327 --- libunwind/CMakeLists.txt | 4 +++- libunwind/src/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index 5acc4c2..eef7479 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -133,6 +133,8 @@ option(LIBUNWIND_ENABLE_THREADS "Build libunwind with threading support." ON) option(LIBUNWIND_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) option(LIBUNWIND_INCLUDE_DOCS "Build the libunwind documentation." ${LLVM_INCLUDE_DOCS}) +set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING + "Define suffix of library directory name (32/64)") set(LIBUNWIND_TARGET_TRIPLE "" CACHE STRING "Target triple for cross compiling.") set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.") set(LIBUNWIND_SYSROOT "" CACHE PATH "Sysroot for cross compiling.") @@ -165,7 +167,7 @@ set(LIBUNWIND_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) if (LLVM_LIBRARY_OUTPUT_INTDIR) set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) else() - set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) + set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX}) endif() set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR}) diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt index 97c4f3f..84ed15c 100644 --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -133,6 +133,6 @@ endif() add_custom_target(unwind DEPENDS ${LIBUNWIND_TARGETS}) install(TARGETS ${LIBUNWIND_TARGETS} - LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LLVM_LIBDIR_SUFFIX}) + LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} + ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX}) -- 2.7.4