diff options
author | Petr Hosek <phosek@chromium.org> | 2017-07-11 01:42:26 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2017-07-11 01:42:26 +0000 |
commit | 60fe5792ae65c13078c92a347cc2d6ae0e11ebf6 (patch) | |
tree | 1cb55f661560ed9cb0683c54a069e46e49af190a /libcxxabi | |
parent | 4e0f5744dcdefb7feb750c8d81b6a4b836455f46 (diff) | |
download | llvm-60fe5792ae65c13078c92a347cc2d6ae0e11ebf6.zip llvm-60fe5792ae65c13078c92a347cc2d6ae0e11ebf6.tar.gz llvm-60fe5792ae65c13078c92a347cc2d6ae0e11ebf6.tar.bz2 |
[libcxxabi][CMake] Add install path variable to allow overriding the destination
This is going to be used by the runtime build in the multi-target
setup to allow using different install prefix for each target.
Differential Revision: https://reviews.llvm.org/D33761
llvm-svn: 307611
Diffstat (limited to 'libcxxabi')
-rw-r--r-- | libcxxabi/CMakeLists.txt | 7 | ||||
-rw-r--r-- | libcxxabi/src/CMakeLists.txt | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 2b3733d..99d4634 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -156,6 +156,13 @@ else() set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX}) endif() +set(LIBCXXABI_INSTALL_PREFIX "" CACHE STRING + "Define libc++abi destination prefix.") + +if (NOT LIBCXXABI_INSTALL_PREFIX MATCHES "^$|.*/") + message(FATAL_ERROR "LIBCXXABI_INSTALL_PREFIX has to end with \"/\".") +endif() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR}) diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt index ff47ed3..adcc412 100644 --- a/libcxxabi/src/CMakeLists.txt +++ b/libcxxabi/src/CMakeLists.txt @@ -174,8 +174,8 @@ endif() add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS}) install(TARGETS ${LIBCXXABI_TARGETS} - LIBRARY DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi - ARCHIVE DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi ) if (NOT CMAKE_CONFIGURATION_TYPES) |