From: Benjamin Kramer Date: Thu, 17 Nov 2016 15:22:36 +0000 (+0000) Subject: Link include-fixer into libclang if clang-tools-extra is checked out. X-Git-Tag: llvmorg-4.0.0-rc1~4300 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9eba7354bb516effd6e151ef0b6867001137bb15;p=platform%2Fupstream%2Fllvm.git Link include-fixer into libclang if clang-tools-extra is checked out. include-fixer only slightly bloats the size of libclang, but since libclang has no explicit plugin mechanism it's the only way of getting this to work. Clang-tidy is already there and so far there weren't many complaints ;) This is designed to be easy to remove again if libclang ever grows proper plugin support. llvm-svn: 287229 --- diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index b90da16..9a61560 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -8120,4 +8120,10 @@ cxindex::Logger::~Logger() { extern volatile int ClangTidyPluginAnchorSource; static int LLVM_ATTRIBUTE_UNUSED ClangTidyPluginAnchorDestination = ClangTidyPluginAnchorSource; + +// This anchor is used to force the linker to link the clang-include-fixer +// plugin. +extern volatile int ClangIncludeFixerPluginAnchorSource; +static int LLVM_ATTRIBUTE_UNUSED ClangIncludeFixerPluginAnchorDestination = + ClangIncludeFixerPluginAnchorSource; #endif diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt index 630be12..2dd6703 100644 --- a/clang/tools/libclang/CMakeLists.txt +++ b/clang/tools/libclang/CMakeLists.txt @@ -50,6 +50,7 @@ endif () if (TARGET clangTidyPlugin) add_definitions(-DCLANG_TOOL_EXTRA_BUILD) list(APPEND LIBS clangTidyPlugin) + list(APPEND LIBS clangIncludeFixerPlugin) endif () find_library(DL_LIBRARY_PATH dl)