diff options
author | Petr Hosek <phosek@chromium.org> | 2017-11-17 23:25:09 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2017-11-17 23:25:09 +0000 |
commit | 43600b48fcd9201db390d94ffcce2625c5925f07 (patch) | |
tree | 6d95bb6998b14b9c0e0d905f93ed189fe51fe7ab | |
parent | 3568730f18d72e45c2f2a1bc12e42ee3166d3fcb (diff) |
[libcxxabi][CMake] Provide option to disable installing of the library
This is useful in cases where we only build static library and
libc++abi.a is combined with libc++.a into a single archive in which
case we don't want to have libc++abi.a installed separately. The same
option is already provided by libcxx CMake build.
Differential Revision: https://reviews.llvm.org/D40194
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@318568 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/CMakeLists.txt | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 456250e..8d13395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ option(LIBCXXABI_BUILD_32_BITS "Build 32 bit libc++abi." ${LLVM_BUILD_32_BITS}) option(LIBCXXABI_INCLUDE_TESTS "Generate build targets for the libc++abi unit tests." ${LLVM_INCLUDE_TESTS}) set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING "Define suffix of library directory name (32/64)") +option(LIBCXXABI_INSTALL_LIBRARY "Install the libc++abi library." ON) set(LIBCXXABI_TARGET_TRIPLE "" CACHE STRING "Target triple for cross compiling.") set(LIBCXXABI_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.") set(LIBCXXABI_SYSROOT "" CACHE PATH "Sysroot for cross compiling.") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23e8c88..32e04c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -179,12 +179,14 @@ endif() # Add a meta-target for both libraries. add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS}) -install(TARGETS ${LIBCXXABI_TARGETS} - LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi - ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi - ) +if (LIBCXXABI_INSTALL_LIBRARY) + install(TARGETS ${LIBCXXABI_TARGETS} + LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi + ) +endif() -if (NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_CONFIGURATION_TYPES AND LIBCXXABI_INSTALL_LIBRARY) add_custom_target(install-cxxabi DEPENDS cxxabi COMMAND "${CMAKE_COMMAND}" |