[PATCH] D40195: [libunwind][CMake] Provide option to disable instalation of the library

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 17 15:29:53 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL318569: [libunwind][CMake] Provide option to disable instalation of the library (authored by phosek).

Changed prior to commit:
  https://reviews.llvm.org/D40195?vs=123413&id=123440#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40195

Files:
  libunwind/trunk/CMakeLists.txt
  libunwind/trunk/src/CMakeLists.txt


Index: libunwind/trunk/src/CMakeLists.txt
===================================================================
--- libunwind/trunk/src/CMakeLists.txt
+++ libunwind/trunk/src/CMakeLists.txt
@@ -132,7 +132,16 @@
 # Add a meta-target for both libraries.
 add_custom_target(unwind DEPENDS ${LIBUNWIND_TARGETS})
 
-install(TARGETS ${LIBUNWIND_TARGETS}
-  LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX}
-  ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX})
+if (LIBUNWIND_INSTALL_LIBRARY)
+  install(TARGETS ${LIBUNWIND_TARGETS}
+    LIBRARY DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind
+    ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_PREFIX}lib${LIBUNWIND_LIBDIR_SUFFIX} COMPONENT unwind)
+endif()
 
+if (NOT CMAKE_CONFIGURATION_TYPES AND LIBUNWIND_INSTALL_LIBRARY)
+  add_custom_target(install-unwind
+    DEPENDS unwind
+    COMMAND "${CMAKE_COMMAND}"
+            -DCMAKE_INSTALL_COMPONENT=unwind
+            -P "${LIBCXXABI_BINARY_DIR}/cmake_install.cmake")
+endif()
Index: libunwind/trunk/CMakeLists.txt
===================================================================
--- libunwind/trunk/CMakeLists.txt
+++ libunwind/trunk/CMakeLists.txt
@@ -135,6 +135,7 @@
 
 set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
     "Define suffix of library directory name (32/64)")
+option(LIBUNWIND_INSTALL_LIBRARY "Install the libunwind library." ON)
 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.")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40195.123440.patch
Type: text/x-patch
Size: 1685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171117/b5a4ffdf/attachment-0001.bin>


More information about the cfe-commits mailing list