]> granicus.if.org Git - clang/commitdiff
[examples] Use loadable modules instead of shared libraries for Clang plugins.
authorJordan Rose <jordan_rose@apple.com>
Wed, 12 Feb 2014 21:04:23 +0000 (21:04 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 12 Feb 2014 21:04:23 +0000 (21:04 +0000)
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
examples/PrintFunctionNames/Makefile
examples/analyzer-plugin/CMakeLists.txt

index cd88f973f5ef204d1da895c4f83ee9b06d0201fd..dcc39a57683b46623ccbfdf88a5ffd8d1920edd4 100644 (file)
@@ -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 "")
index 23a53054019d126efc3a4ed71fbe59a6f5d1b5f6..5865098bd305d91b05a64c908ac995b77d652ccf 100644 (file)
@@ -19,7 +19,7 @@ endif
 endif
 
 LINK_LIBS_IN_SHARED = 0
-SHARED_LIBRARY = 1
+LOADABLE_MODULE = 1
 
 include $(CLANG_LEVEL)/Makefile
 
index 9984880b2eb720bfae997d0e5c71c70c49665ff4..a58f57c487f62027a9c62eb7dd6936b621f43aef 100644 (file)
@@ -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 "")