-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
135 lines (122 loc) · 2.87 KB
/
Copy pathCMakeLists.txt
File metadata and controls
135 lines (122 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
cmake_minimum_required(VERSION 3.16)
project(DSAnnotation)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(LLVM REQUIRED CONFIG)
find_package(Clang REQUIRED CONFIG)
find_package(GTest CONFIG REQUIRED)
set(DSANNOTATION_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
add_library(dsannotation_core
src/core/Component.cpp
src/core/ErrorCollector.cpp
src/core/Reference.cpp
)
target_include_directories(dsannotation_core
PUBLIC
${DSANNOTATION_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
)
add_library(dsannotation_support
src/support/ErrorReporter.cpp
src/support/LocalFileSystem.cpp
)
target_link_libraries(dsannotation_support
PUBLIC
dsannotation_core
)
target_include_directories(dsannotation_support
PUBLIC
${DSANNOTATION_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
)
add_library(dsannotation_parsing
src/parsing/ASTVisitor.cpp
src/parsing/ComponentParser.cpp
src/parsing/PropertyParser.cpp
src/parsing/ReferenceParser.cpp
src/parsing/AnnotationValidator.cpp
)
target_link_libraries(dsannotation_parsing
PUBLIC
dsannotation_core
dsannotation_support
)
target_include_directories(dsannotation_parsing
PUBLIC
${DSANNOTATION_INCLUDE_DIR}
${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
)
add_library(dsannotation_serialization
src/serialization/JsonManifestBuilder.cpp
src/serialization/JsonManifestWriter.cpp
src/serialization/ManifestMerger.cpp
)
target_link_libraries(dsannotation_serialization
PUBLIC
dsannotation_core
dsannotation_support
)
target_include_directories(dsannotation_serialization
PUBLIC
${DSANNOTATION_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
)
add_executable(dsannotation
app/main.cpp
)
target_include_directories(dsannotation
PRIVATE
${DSANNOTATION_INCLUDE_DIR}
${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)
if (WIN32)
set(CLANG_LIBS
clangTooling
clangFrontend
clangDriver
clangParse
clangSerialization
clangSema
clangEdit
clangAnalysis
clangAST
clangLex
clangBasic
)
llvm_map_components_to_libnames(LLVM_LIBS
support
core
option
binaryformat
mc
bitreader
profiledata
demangle
)
else()
set(CLANG_LIBS clang-cpp)
set(LLVM_LIBS LLVM)
endif()
target_link_libraries(dsannotation
PRIVATE
dsannotation_parsing
dsannotation_serialization
${CLANG_LIBS}
${LLVM_LIBS}
)
target_compile_definitions(dsannotation
PRIVATE
${LLVM_DEFINITIONS}
)
enable_testing()
add_subdirectory(tests)