summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--examples/PrintFunctionNames/CMakeLists.txt19
-rw-r--r--examples/analyzer-plugin/CMakeLists.txt17
-rw-r--r--examples/clang-interpreter/CMakeLists.txt59
4 files changed, 59 insertions, 38 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 19d8869..84a5d2c 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,5 +1,5 @@
if(NOT CLANG_BUILD_EXAMPLES)
- set(EXCLUDE_FROM_ALL ON)
+ set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
endif()
add_subdirectory(analyzer-plugin)
diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt
index 86793ce..ba6a350 100644
--- a/examples/PrintFunctionNames/CMakeLists.txt
+++ b/examples/PrintFunctionNames/CMakeLists.txt
@@ -1,14 +1,23 @@
set(MODULE TRUE)
-set( LLVM_USED_LIBS
- clangFrontend
- clangAST
- )
-
set( LLVM_LINK_COMPONENTS support mc)
add_clang_library(PrintFunctionNames PrintFunctionNames.cpp)
+add_dependencies(PrintFunctionNames
+ ClangAttrClasses
+ ClangAttrList
+ ClangCommentNodes
+ ClangDeclNodes
+ ClangDiagnosticCommon
+ ClangStmtNodes
+ )
+
+target_link_libraries(PrintFunctionNames
+ clangFrontend
+ clangAST
+ )
+
set_target_properties(PrintFunctionNames
PROPERTIES
LINKER_LANGUAGE CXX
diff --git a/examples/analyzer-plugin/CMakeLists.txt b/examples/analyzer-plugin/CMakeLists.txt
index 2b9d825..ba73030 100644
--- a/examples/analyzer-plugin/CMakeLists.txt
+++ b/examples/analyzer-plugin/CMakeLists.txt
@@ -1,13 +1,22 @@
set(MODULE TRUE)
-set( LLVM_USED_LIBS
- clangStaticAnalyzerCore
- )
-
set( LLVM_LINK_COMPONENTS support mc)
add_clang_library(SampleAnalyzerPlugin MainCallChecker.cpp)
+add_dependencies(SampleAnalyzerPlugin
+ ClangAttrClasses
+ ClangAttrList
+ ClangCommentNodes
+ ClangDeclNodes
+ ClangDiagnosticCommon
+ ClangStmtNodes
+ )
+
+target_link_libraries(SampleAnalyzerPlugin
+ clangStaticAnalyzerCore
+ )
+
set_target_properties(SampleAnalyzerPlugin
PROPERTIES
LINKER_LANGUAGE CXX
diff --git a/examples/clang-interpreter/CMakeLists.txt b/examples/clang-interpreter/CMakeLists.txt
index 809e324..9abefc2 100644
--- a/examples/clang-interpreter/CMakeLists.txt
+++ b/examples/clang-interpreter/CMakeLists.txt
@@ -1,34 +1,37 @@
-set(LLVM_USED_LIBS
- clangFrontend
- clangSerialization
- clangDriver
- clangCodeGen
- clangSema
- clangStaticAnalyzerFrontend
- clangStaticAnalyzerCheckers
- clangStaticAnalyzerCore
- clangAnalysis
- clangRewrite
- clangAST
- clangParse
- clangLex
- clangBasic
- )
-
set(LLVM_LINK_COMPONENTS
- jit
- interpreter
- nativecodegen
- asmparser
- bitreader
- bitwriter
- codegen
- ipo
- linker
- selectiondag
+ jit
+ interpreter
+ nativecodegen
+ asmparser
+ bitreader
+ bitwriter
+ codegen
+ ipo
+ linker
+ selectiondag
)
add_clang_executable(clang-interpreter
main.cpp
)
-add_dependencies(clang-interpreter clang-headers)
+
+add_dependencies(clang-interpreter
+ clang-headers
+ )
+
+target_link_libraries(clang-interpreter
+ clangFrontend
+ clangSerialization
+ clangDriver
+ clangCodeGen
+ clangSema
+ clangStaticAnalyzerFrontend
+ clangStaticAnalyzerCheckers
+ clangStaticAnalyzerCore
+ clangAnalysis
+ clangRewrite
+ clangAST
+ clangParse
+ clangLex
+ clangBasic
+ )
OpenPOWER on IntegriCloud