From 68db107c81832dd13fdc37e334b22c5274b54e73 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. llvm-svn: 201256 --- .../examples/PrintFunctionNames/CMakeLists.txt | 17 +---------------- clang/examples/PrintFunctionNames/Makefile | 2 +- clang/examples/analyzer-plugin/CMakeLists.txt | 14 +------------- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/clang/examples/PrintFunctionNames/CMakeLists.txt b/clang/examples/PrintFunctionNames/CMakeLists.txt index cd88f973f5ef..dcc39a57683b 100644 --- a/clang/examples/PrintFunctionNames/CMakeLists.txt +++ b/clang/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/clang/examples/PrintFunctionNames/Makefile b/clang/examples/PrintFunctionNames/Makefile index 23a53054019d..5865098bd305 100644 --- a/clang/examples/PrintFunctionNames/Makefile +++ b/clang/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/clang/examples/analyzer-plugin/CMakeLists.txt b/clang/examples/analyzer-plugin/CMakeLists.txt index 9984880b2eb7..a58f57c487f6 100644 --- a/clang/examples/analyzer-plugin/CMakeLists.txt +++ b/clang/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 "")