From a4015cc0447ecd53e16a3d76c5719c2f8736b331 Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Fri, 15 Feb 2019 15:59:04 +0000 Subject: [clang] Add build and install targets for clang libraries This is modeled after the existing llvm-libraries target. It's a convenient way to include all clang libraries in a distribution. This differs slightly from the llvm-libraries target in that it adds any library added via add_clang_library, whereas llvm-libraries only includes targets added via add_llvm_library that didn't use the MODULE or BUILDTREE_ONLY arguments. add_clang_library doesn't appear to have any equivalents of those arguments, so the conditions don't apply. Differential Revision: https://reviews.llvm.org/D58269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354141 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c2016a45ca..40cf7dfdf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,6 +543,27 @@ if( CLANG_INCLUDE_DOCS ) add_subdirectory(docs) endif() +# Custom target to install all clang libraries. +add_custom_target(clang-libraries) +set_target_properties(clang-libraries PROPERTIES FOLDER "Misc") + +if(NOT CMAKE_CONFIGURATION_TYPES) + add_llvm_install_targets(install-clang-libraries + DEPENDS clang-libraries + COMPONENT clang-libraries) +endif() + +get_property(CLANG_LIBS GLOBAL PROPERTY CLANG_LIBS) +if(CLANG_LIBS) + list(REMOVE_DUPLICATES CLANG_LIBS) + foreach(lib ${CLANG_LIBS}) + add_dependencies(clang-libraries ${lib}) + if(NOT CMAKE_CONFIGURATION_TYPES) + add_dependencies(install-clang-libraries install-${lib}) + endif() + endforeach() +endif() + add_subdirectory(cmake/modules) if(CLANG_STAGE) -- cgit v1.2.1