summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2014-02-12 21:04:23 +0000
committerJordan Rose <jordan_rose@apple.com>2014-02-12 21:04:23 +0000
commitc766e50ffb699ee68de9b5b488deb8b862f30277 (patch)
tree14bff2e4a57c25e8e55e53b2243f76c9159b61ba /examples
parent63405b9c46eb3d2666f6422c073bb0c61fbc8bfa (diff)
downloadclang-c766e50ffb699ee68de9b5b488deb8b862f30277.tar.gz
clang-c766e50ffb699ee68de9b5b488deb8b862f30277.tar.bz2
clang-c766e50ffb699ee68de9b5b488deb8b862f30277.tar.xz
[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
Diffstat (limited to 'examples')
-rw-r--r--examples/PrintFunctionNames/CMakeLists.txt17
-rw-r--r--examples/PrintFunctionNames/Makefile2
-rw-r--r--examples/analyzer-plugin/CMakeLists.txt14
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 "")