d25745f94c7b9a9e032c3f53c50059492333c5b3
[lldb.git] / clang-tools-extra / clangd / unittests / CMakeLists.txt
1 set(LLVM_LINK_COMPONENTS
2   support
3   )
4
5 get_filename_component(CLANGD_SOURCE_DIR
6   ${CMAKE_CURRENT_SOURCE_DIR}/../../clangd REALPATH)
7 get_filename_component(CLANGD_BINARY_DIR
8   ${CMAKE_CURRENT_BINARY_DIR}/../../clangd REALPATH)
9 include_directories(
10   ${CLANGD_SOURCE_DIR}
11   ${CLANGD_BINARY_DIR}
12   )
13
14 if(CLANG_BUILT_STANDALONE)
15   # LLVMTestingSupport library is needed for clangd tests.
16   if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
17       AND NOT TARGET LLVMTestingSupport)
18     add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
19       lib/Testing/Support)
20   endif()
21 endif()
22
23 add_custom_target(ClangdUnitTests)
24 add_unittest(ClangdUnitTests ClangdTests
25   Annotations.cpp
26   ASTTests.cpp
27   BackgroundIndexTests.cpp
28   CancellationTests.cpp
29   CanonicalIncludesTests.cpp
30   ClangdTests.cpp
31   CodeCompleteTests.cpp
32   CodeCompletionStringsTests.cpp
33   ContextTests.cpp
34   DexTests.cpp
35   DiagnosticsTests.cpp
36   DraftStoreTests.cpp
37   ExpectedTypeTest.cpp
38   FileDistanceTests.cpp
39   FileIndexTests.cpp
40   FindSymbolsTests.cpp
41   FindTargetTests.cpp
42   FormattedStringTests.cpp
43   FormatTests.cpp
44   FSTests.cpp
45   FunctionTests.cpp
46   FuzzyMatchTests.cpp
47   GlobalCompilationDatabaseTests.cpp
48   HeadersTests.cpp
49   HeaderSourceSwitchTests.cpp
50   IndexActionTests.cpp
51   IndexTests.cpp
52   JSONTransportTests.cpp
53   ParsedASTTests.cpp
54   PrintASTTests.cpp
55   QualityTests.cpp
56   RenameTests.cpp
57   RIFFTests.cpp
58   SelectionTests.cpp
59   SemanticHighlightingTests.cpp
60   SemanticSelectionTests.cpp
61   SerializationTests.cpp
62   SourceCodeTests.cpp
63   SymbolCollectorTests.cpp
64   SymbolInfoTests.cpp
65   SyncAPI.cpp
66   TUSchedulerTests.cpp
67   TestFS.cpp
68   TestIndex.cpp
69   TestTU.cpp
70   ThreadingTests.cpp
71   TraceTests.cpp
72   TypeHierarchyTests.cpp
73   TweakTests.cpp
74   TweakTesting.cpp
75   URITests.cpp
76   XRefsTests.cpp
77
78   $<TARGET_OBJECTS:obj.clangDaemonTweaks>
79   )
80
81 target_link_libraries(ClangdTests
82   PRIVATE
83   clangAST
84   clangBasic
85   clangDaemon
86   clangFormat
87   clangFrontend
88   clangIndex
89   clangLex
90   clangSema
91   clangSerialization
92   clangTidy
93   clangTooling
94   clangToolingCore
95   clangToolingInclusions
96   clangToolingRefactoring
97   clangToolingSyntax
98   LLVMSupport
99   LLVMTestingSupport
100   )
101
102 if (CLANGD_BUILD_XPC)
103   add_subdirectory(xpc)
104 endif ()
105
106 configure_lit_site_cfg(
107   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
108   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)