From c766e50ffb699ee68de9b5b488deb8b862f30277 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Wed, 12 Feb 2014 21:04:23 +0000 Subject: [PATCH] [examples] Use loadable modules instead of shared libraries for Clang plugins. This avoids linking in extra copies of, say, LLVMSupport. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201256 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/PrintFunctionNames/CMakeLists.txt | 17 +---------------- examples/PrintFunctionNames/Makefile | 2 +- examples/analyzer-plugin/CMakeLists.txt | 14 +------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt index cd88f973f5..dcc39a5768 100644 --- a/examples/PrintFunctionNames/CMakeLists.txt +++ b/examples/PrintFunctionNames/CMakeLists.txt @@ -1,7 +1,3 @@ -set( LLVM_LINK_COMPONENTS - Support - ) - # If we don't need RTTI or EH, there's no reason to export anything # from the plugin. if( NOT WIN32 ) # Win32 mangles symbols differently, and @@ -13,7 +9,7 @@ if( NOT WIN32 ) # Win32 mangles symbols differently, and endif() endif() -add_clang_library(PrintFunctionNames MODULE PrintFunctionNames.cpp) +add_llvm_loadable_module(PrintFunctionNames PrintFunctionNames.cpp) add_dependencies(PrintFunctionNames ClangAttrClasses @@ -23,14 +19,3 @@ add_dependencies(PrintFunctionNames ClangDiagnosticCommon ClangStmtNodes ) - -target_link_libraries(PrintFunctionNames - clangAST - clangBasic - clangFrontend - ) - -set_target_properties(PrintFunctionNames - PROPERTIES - LINKER_LANGUAGE CXX - PREFIX "") diff --git a/examples/PrintFunctionNames/Makefile b/examples/PrintFunctionNames/Makefile index 23a5305401..5865098bd3 100644 --- a/examples/PrintFunctionNames/Makefile +++ b/examples/PrintFunctionNames/Makefile @@ -19,7 +19,7 @@ endif endif LINK_LIBS_IN_SHARED = 0 -SHARED_LIBRARY = 1 +LOADABLE_MODULE = 1 include $(CLANG_LEVEL)/Makefile diff --git a/examples/analyzer-plugin/CMakeLists.txt b/examples/analyzer-plugin/CMakeLists.txt index 9984880b2e..a58f57c487 100644 --- a/examples/analyzer-plugin/CMakeLists.txt +++ b/examples/analyzer-plugin/CMakeLists.txt @@ -1,8 +1,4 @@ -set(LLVM_LINK_COMPONENTS - Support - ) - -add_clang_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp) +add_llvm_loadable_module(SampleAnalyzerPlugin MainCallChecker.cpp) add_dependencies(SampleAnalyzerPlugin ClangAttrClasses @@ -11,15 +7,7 @@ add_dependencies(SampleAnalyzerPlugin ClangDeclNodes ClangDiagnosticCommon ClangStmtNodes - ) - -target_link_libraries(SampleAnalyzerPlugin clangAST clangAnalysis clangStaticAnalyzerCore ) - -set_target_properties(SampleAnalyzerPlugin - PROPERTIES - LINKER_LANGUAGE CXX - PREFIX "") -- 2.40.0