summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2018-06-29 20:27:40 +0000
committerEric Christopher <echristo@gmail.com>2018-06-29 20:27:40 +0000
commit8b44248919f6e4d2a9b5ae1d67c65f5ac3668cf8 (patch)
tree4d90438e3f830e285222b2a4b93ad441cc62cb68
parentc072133855f676f42659ceb72f54db70a395c91e (diff)
Revert "Revert "Support for multiarch runtimes layout""
This reverts commit r336005 that was accidentally committed. git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@336012 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd70981..fc46764 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -170,7 +170,14 @@ set(CMAKE_MODULE_PATH
set(LIBUNWIND_COMPILER ${CMAKE_CXX_COMPILER})
set(LIBUNWIND_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBUNWIND_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-if (LLVM_LIBRARY_OUTPUT_INTDIR)
+
+string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
+ ${PACKAGE_VERSION})
+
+if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
+ set(DEFAULT_INSTALL_PREFIX lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/${LLVM_DEFAULT_TARGET_TRIPLE}/)
+ set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/${LLVM_DEFAULT_TARGET_TRIPLE}/lib${LLVM_RUNTIMES_LIBDIR_SUFFIX})
+elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
set(LIBUNWIND_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
else()
set(LIBUNWIND_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBUNWIND_LIBDIR_SUFFIX})
@@ -180,13 +187,9 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBUNWIND_LIBRARY_DIR})
-set(LIBUNWIND_INSTALL_PREFIX "" CACHE STRING
+set(LIBUNWIND_INSTALL_PREFIX ${DEFAULT_INSTALL_PREFIX} CACHE STRING
"Define libunwind destination prefix.")
-if (NOT LIBUNWIND_INSTALL_PREFIX MATCHES "^$|.*/")
- message(FATAL_ERROR "LIBUNWIND_INSTALL_PREFIX has to end with \"/\".")
-endif()
-
set(LIBUNWIND_C_FLAGS "")
set(LIBUNWIND_CXX_FLAGS "")
set(LIBUNWIND_COMPILE_FLAGS "")