r201256 - [examples] Use loadable modules instead of shared libraries for Clang plugins.

Jordan Rose jordan_rose at apple.com
Wed Feb 12 13:04:23 PST 2014


Author: jrose
Date: Wed Feb 12 15:04:23 2014
New Revision: 201256

URL: http://llvm.org/viewvc/llvm-project?rev=201256&view=rev
Log:
[examples] Use loadable modules instead of shared libraries for Clang plugins.

This avoids linking in extra copies of, say, LLVMSupport.

Modified:
    cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
    cfe/trunk/examples/PrintFunctionNames/Makefile
    cfe/trunk/examples/analyzer-plugin/CMakeLists.txt

Modified: cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt?rev=201256&r1=201255&r2=201256&view=diff
==============================================================================
--- cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt (original)
+++ cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt Wed Feb 12 15:04:23 2014
@@ -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
   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 "")

Modified: cfe/trunk/examples/PrintFunctionNames/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/Makefile?rev=201256&r1=201255&r2=201256&view=diff
==============================================================================
--- cfe/trunk/examples/PrintFunctionNames/Makefile (original)
+++ cfe/trunk/examples/PrintFunctionNames/Makefile Wed Feb 12 15:04:23 2014
@@ -19,7 +19,7 @@ endif
 endif
 
 LINK_LIBS_IN_SHARED = 0
-SHARED_LIBRARY = 1
+LOADABLE_MODULE = 1
 
 include $(CLANG_LEVEL)/Makefile
 

Modified: cfe/trunk/examples/analyzer-plugin/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/analyzer-plugin/CMakeLists.txt?rev=201256&r1=201255&r2=201256&view=diff
==============================================================================
--- cfe/trunk/examples/analyzer-plugin/CMakeLists.txt (original)
+++ cfe/trunk/examples/analyzer-plugin/CMakeLists.txt Wed Feb 12 15:04:23 2014
@@ -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 "")





More information about the cfe-commits mailing list