summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/driver/CMakeLists.txt3
-rw-r--r--tools/driver/driver.cpp15
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt
index 22a498422a..19e0cf18a2 100644
--- a/tools/driver/CMakeLists.txt
+++ b/tools/driver/CMakeLists.txt
@@ -44,6 +44,9 @@ target_link_libraries(clang
clangDriver
clangFrontend
clangFrontendTool
+ clangTidyPlugin
+ clangIncludeFixerPlugin
+ clazyPlugin
)
if(WIN32 AND NOT CYGWIN)
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index fa757da953..a4c4bdd0a9 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -518,3 +518,18 @@ int main(int argc_, const char **argv_) {
// failing command.
return Res;
}
+
+// This anchor is used to force the linker to link the clang-tidy plugin.
+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;
+
+// This anchor is used to force the linker to link the clazy plugin.
+extern volatile int ClazyPluginAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED ClazyPluginAnchorDestination = ClazyPluginAnchorSource;