diff options
author | Tom Stellard <tstellar@redhat.com> | 2019-07-12 14:40:18 +0000 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2019-07-12 14:40:18 +0000 |
commit | f15fa2a55b893cc09e792114220647a8b97e811a (patch) | |
tree | a10eca8f7c6e51c67a9935416ac4edaf5adbe47a | |
parent | 687abbe102538f753758ce3b0f9d6c695c6db1e6 (diff) | |
download | clang-f15fa2a55b893cc09e792114220647a8b97e811a.tar.gz |
cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros
Summary:
This will simplify the macros by allowing us to remove the hard-coded
list of libraries that should be installed when
LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.
Reviewers: beanz, smeenai
Reviewed By: beanz
Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64580
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365902 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | cmake/modules/AddClang.cmake | 4 | ||||
-rw-r--r-- | tools/libclang/CMakeLists.txt | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake index 9f478496e4..cbd618e18a 100644 --- a/cmake/modules/AddClang.cmake +++ b/cmake/modules/AddClang.cmake @@ -44,7 +44,7 @@ endmacro() macro(add_clang_library name) cmake_parse_arguments(ARG - "SHARED" + "SHARED;INSTALL_WITH_TOOLCHAIN" "" "ADDITIONAL_HEADERS" ${ARGN}) @@ -97,7 +97,7 @@ macro(add_clang_library name) if(TARGET ${name}) target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS}) - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang") + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) set(export_to_clangtargets) if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR "clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt index a2804ab17c..613ead1a36 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -94,7 +94,7 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX") remove_definitions("-D_XOPEN_SOURCE=700") endif() -add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} +add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} INSTALL_WITH_TOOLCHAIN OUTPUT_NAME ${output_name} ${SOURCES} DEPENDS clang-resource-headers |