@@ -28,18 +28,7 @@ set(LLVM_LINK_COMPONENTS
28
28
Option
29
29
)
30
30
31
- # CMake function to generate clangDaemon and 3cClangDaemon targets, minimizing
32
- # the diff in this file from upstream Clang to ease future merging.
33
- function (add_clangDaemon_target target_name )
34
- cmake_parse_arguments (ARG "" "" "EXTRA_LIBS" ${ARGN} )
35
-
36
- add_clang_library (${target_name}
37
- # If we omitted these from the clangDaemon target, llvm_check_source_file_list
38
- # would raise an error. We could use LLVM_OPTIONAL_SOURCES, but it doesn't
39
- # seem worth it.
40
- 3CCommands.cpp
41
- 3CDiagnostics.cpp
42
-
31
+ add_clang_library (clangDaemon
43
32
AST.cpp
44
33
ClangdLSPServer.cpp
45
34
ClangdServer.cpp
@@ -121,7 +110,7 @@ add_clang_library(${target_name}
121
110
omp_gen
122
111
)
123
112
124
- clang_target_link_libraries (${target_name}
113
+ clang_target_link_libraries (clangDaemon
125
114
PRIVATE
126
115
clangAST
127
116
clangASTMatchers
@@ -138,42 +127,8 @@ clang_target_link_libraries(${target_name}
138
127
clangToolingInclusions
139
128
clangToolingRefactoring
140
129
clangToolingSyntax
141
- ${ARG_EXTRA_LIBS}
142
130
)
143
131
144
- endfunction ()
145
-
146
- # Some whole-program analysis tools (including IDEs) do not cope well with the
147
- # clangd source files being included in the compilation database twice with
148
- # different preprocessor flags that lead to significantly different portions of
149
- # each file being included in the compilation. To avoid this problem,
150
- # CLANGD_EXCLUSIVE_VARIANT can be set to include only one variant of clangd in
151
- # the configuration. This can be used, for example, to rename a program element
152
- # that is part of 3C and update references to it in clangd3c. If you want to
153
- # rename an upstream Clang program element that is referenced in both
154
- # INTERACTIVE3C and !INTERACTIVE3C blocks, this won't help; fortunately, we have
155
- # never needed to do that so far.
156
- set (CLANGD_KNOWN_VARIANTS "clangd;clangd3c" )
157
- set (CLANGD_EXCLUSIVE_VARIANT "" CACHE STRING
158
- "Variant of clangd to include in the configuration. If empty, include all variants." )
159
- set_property (CACHE CLANGD_EXCLUSIVE_VARIANT
160
- PROPERTY STRINGS ";${CLANGD_KNOWN_VARIANTS} " )
161
- foreach (variant ${CLANGD_KNOWN_VARIANTS} )
162
- if (CLANGD_EXCLUSIVE_VARIANT STREQUAL "" OR
163
- CLANGD_EXCLUSIVE_VARIANT STREQUAL variant )
164
- set (CLANGD_INCLUDE_VARIANT_${variant} ON )
165
- endif ()
166
- endforeach ()
167
-
168
- if (CLANGD_INCLUDE_VARIANT_clangd )
169
- add_clangDaemon_target (clangDaemon )
170
- endif ()
171
-
172
- if (CLANGD_INCLUDE_VARIANT_clangd3c )
173
- add_clangDaemon_target (3cClangDaemon EXTRA_LIBS clang3C )
174
- target_compile_definitions (obj.3cClangDaemon PRIVATE INTERACTIVE3C=1 )
175
- endif ()
176
-
177
132
add_subdirectory (refactor/tweaks )
178
133
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
179
134
# FIXME: Make fuzzer not use linux-specific APIs, build it everywhere.
@@ -189,7 +144,7 @@ if ( CLANGD_BUILD_XPC )
189
144
add_subdirectory (xpc )
190
145
endif ()
191
146
192
- if (CLANG_INCLUDE_TESTS AND CLANGD_INCLUDE_VARIANT_clangd )
147
+ if (CLANG_INCLUDE_TESTS )
193
148
add_subdirectory (test )
194
149
add_subdirectory (unittests )
195
150
endif ()
0 commit comments