File tree Expand file tree Collapse file tree 28 files changed +289
-162
lines changed Expand file tree Collapse file tree 28 files changed +289
-162
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,19 @@ add_clang_unittest(InterpTests
2
2
BitcastBuffer.cpp
3
3
Descriptor.cpp
4
4
toAPValue.cpp
5
- CLANG_LIBS
5
+ )
6
+
7
+ clang_target_link_libraries (InterpTests
8
+ PRIVATE
6
9
clangAST
7
10
clangASTMatchers
8
11
clangBasic
9
12
clangFrontend
10
13
clangSerialization
11
14
clangTooling
12
- LINK_LIBS
13
- clangTesting
14
15
)
16
+
17
+ target_link_libraries (InterpTests
18
+ PRIVATE
19
+ clangTesting
20
+ )
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ FrontendOpenMP
3
+ Support
4
+ TargetParser
5
+ )
6
+
7
+
1
8
add_subdirectory (ByteCode )
2
9
3
10
add_clang_unittest (ASTTests
@@ -36,20 +43,22 @@ add_clang_unittest(ASTTests
36
43
TemplateNameTest.cpp
37
44
TypePrinterTest.cpp
38
45
UnresolvedSetTest.cpp
39
- CLANG_LIBS
46
+ )
47
+
48
+ clang_target_link_libraries (ASTTests
49
+ PRIVATE
40
50
clangAST
41
51
clangASTMatchers
42
52
clangBasic
43
53
clangFrontend
44
54
clangLex
45
55
clangSerialization
46
56
clangTooling
47
- LINK_LIBS
57
+ )
58
+
59
+ target_link_libraries (ASTTests
60
+ PRIVATE
48
61
clangTesting
49
62
LLVMTestingAnnotations
50
63
LLVMTestingSupport
51
- LLVM_COMPONENTS
52
- FrontendOpenMP
53
- Support
54
- TargetParser
55
- )
64
+ )
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ FrontendOpenMP
3
+ Support
4
+ TargetParser
5
+ )
6
+
1
7
add_clang_unittest (ASTMatchersTests
2
8
ASTMatchersInternalTest.cpp
3
9
ASTMatchersNodeTest.cpp
4
10
ASTMatchersNarrowingTest.cpp
5
11
ASTMatchersTraversalTest.cpp
6
12
GtestMatchersTest.cpp
7
- CLANG_LIBS
13
+ )
14
+
15
+ clang_target_link_libraries (ASTMatchersTests
16
+ PRIVATE
8
17
clangAST
9
18
clangASTMatchers
10
19
clangBasic
11
20
clangFrontend
12
21
clangSerialization
13
22
clangTooling
14
- LINK_LIBS
23
+ )
24
+
25
+ target_link_libraries (ASTMatchersTests
26
+ PRIVATE
15
27
clangTesting
16
28
LLVMTestingSupport
17
- LLVM_COMPONENTS
18
- FrontendOpenMP
19
- Support
20
- TargetParser
21
- )
29
+ )
22
30
23
31
add_subdirectory (Dynamic )
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ FrontendOpenMP
3
+ Support
4
+ )
5
+
1
6
add_clang_unittest (DynamicASTMatchersTests
2
7
VariantValueTest.cpp
3
8
ParserTest.cpp
4
9
RegistryTest.cpp
5
- CLANG_LIBS
10
+ )
11
+
12
+ clang_target_link_libraries (DynamicASTMatchersTests
13
+ PRIVATE
6
14
clangAST
7
15
clangASTMatchers
8
16
clangBasic
9
17
clangDynamicASTMatchers
10
18
clangFrontend
11
19
clangSerialization
12
20
clangTooling
13
- LINK_LIBS
21
+ )
22
+
23
+ target_link_libraries (DynamicASTMatchersTests
24
+ PRIVATE
14
25
clangTesting
15
- LLVM_COMPONENTS
16
- FrontendOpenMP
17
- Support
18
26
)
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ FrontendOpenMP
3
+ Support
4
+ )
5
+
1
6
add_clang_unittest (ClangAnalysisTests
2
7
CFGDominatorTree.cpp
3
8
CFGTest.cpp
@@ -6,7 +11,10 @@ add_clang_unittest(ClangAnalysisTests
6
11
IntervalPartitionTest.cpp
7
12
MacroExpansionContextTest.cpp
8
13
UnsafeBufferUsageTest.cpp
9
- CLANG_LIBS
14
+ )
15
+
16
+ clang_target_link_libraries (ClangAnalysisTests
17
+ PRIVATE
10
18
clangAST
11
19
clangASTMatchers
12
20
clangAnalysis
@@ -15,12 +23,12 @@ add_clang_unittest(ClangAnalysisTests
15
23
clangLex
16
24
clangSerialization
17
25
clangTooling
18
- LINK_LIBS
26
+ )
27
+
28
+ target_link_libraries (ClangAnalysisTests
29
+ PRIVATE
19
30
clangTesting
20
31
LLVMTestingSupport
21
- LLVM_COMPONENTS
22
- FrontendOpenMP
23
- Support
24
32
)
25
33
26
34
add_subdirectory (FlowSensitive )
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ FrontendOpenMP
3
+ Support
4
+ )
5
+
1
6
add_clang_unittest (ClangAnalysisFlowSensitiveTests
2
7
ArenaTest.cpp
3
8
ASTOpsTest.cpp
@@ -25,7 +30,10 @@ add_clang_unittest(ClangAnalysisFlowSensitiveTests
25
30
UncheckedOptionalAccessModelTest.cpp
26
31
ValueTest.cpp
27
32
WatchedLiteralsSolverTest.cpp
28
- CLANG_LIBS
33
+ )
34
+
35
+ clang_target_link_libraries (ClangAnalysisFlowSensitiveTests
36
+ PRIVATE
29
37
clangAST
30
38
clangASTMatchers
31
39
clangAnalysis
@@ -36,11 +44,11 @@ add_clang_unittest(ClangAnalysisFlowSensitiveTests
36
44
clangLex
37
45
clangSerialization
38
46
clangTooling
39
- LINK_LIBS
47
+ )
48
+
49
+ target_link_libraries (ClangAnalysisFlowSensitiveTests
50
+ PRIVATE
40
51
clangTesting
41
52
LLVMTestingAnnotations
42
53
LLVMTestingSupport
43
- LLVM_COMPONENTS
44
- FrontendOpenMP
45
- Support
46
54
)
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ Support
3
+ )
4
+
1
5
add_clang_unittest (BasicTests
2
6
CharInfoTest.cpp
3
7
DarwinSDKInfoTest.cpp
@@ -8,11 +12,15 @@ add_clang_unittest(BasicTests
8
12
SanitizersTest.cpp
9
13
SarifTest.cpp
10
14
SourceManagerTest.cpp
11
- CLANG_LIBS
15
+ )
16
+
17
+ clang_target_link_libraries (BasicTests
18
+ PRIVATE
12
19
clangBasic
13
20
clangLex
14
- LINK_LIBS
15
- LLVMTestingSupport
16
- LLVM_COMPONENTS
17
- Support
18
21
)
22
+
23
+ target_link_libraries (BasicTests
24
+ PRIVATE
25
+ LLVMTestingSupport
26
+ )
Original file line number Diff line number Diff line change @@ -15,36 +15,12 @@ if(CLANG_BUILT_STANDALONE)
15
15
endif ()
16
16
endif ()
17
17
18
- # add_clang_unittest(test_name file1.cpp file2.cpp)
18
+ # add_clang_unittest(test_dirname file1.cpp file2.cpp)
19
19
#
20
20
# Will compile the list of files together and link against the clang
21
- # Produces a binary named 'basename(test_name)'.
22
- function (add_clang_unittest test_name )
23
- cmake_parse_arguments (ARG
24
- ""
25
- ""
26
- "CLANG_LIBS;LINK_LIBS;LLVM_COMPONENTS"
27
- ${ARGN} )
28
-
29
- if (NOT ${test_name} MATCHES "Tests$" )
30
- message (FATAL_ERROR "Unit test name must end with 'Tests' for lit to find it." )
31
- endif ()
32
-
33
- # LLVM_COMPONENTS is for LLVM_LINK_COMPONENTS deps, and must be before
34
- # add_unittest.
35
- list (APPEND LLVM_LINK_COMPONENTS ${ARG_LLVM_COMPONENTS} )
36
-
37
- add_unittest (ClangUnitTests ${test_name} ${ARG_UNPARSED_ARGUMENTS} )
38
-
39
- # Clang libs either come from the entire dylib, or individual libraries.
40
- if (CLANG_LINK_CLANG_DYLIB )
41
- list (APPEND ARG_LINK_LIBS clang-cpp )
42
- else ()
43
- list (APPEND ARG_LINK_LIBS ${ARG_CLANG_LIBS} )
44
- endif ()
45
-
46
- # LINK_LIBS is for normal library dependencies.
47
- target_link_libraries (${test_name} PRIVATE ${ARG_LINK_LIBS} )
21
+ # Produces a binary named 'basename(test_dirname)'.
22
+ function (add_clang_unittest test_dirname )
23
+ add_unittest (ClangUnitTests ${test_dirname} ${ARGN} )
48
24
endfunction ()
49
25
50
26
add_subdirectory (Basic )
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ Core
3
+ Support
4
+ TargetParser
5
+ )
6
+
1
7
add_clang_unittest (ClangCodeGenTests
2
8
BufferSourceTest.cpp
3
9
CodeGenExternalTest.cpp
4
10
TBAAMetadataTest.cpp
5
11
CheckTargetFeaturesTest.cpp
6
- CLANG_LIBS
12
+ )
13
+
14
+ clang_target_link_libraries (ClangCodeGenTests
15
+ PRIVATE
7
16
clangAST
8
17
clangBasic
9
18
clangCodeGen
10
19
clangFrontend
11
20
clangLex
12
21
clangParse
13
22
clangSerialization
14
- LLVM_COMPONENTS
15
- Core
16
- Support
17
- TargetParser
18
23
)
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ ${LLVM_TARGETS_TO_BUILD}
3
+ Support
4
+ )
5
+
1
6
add_clang_unittest (CrossTUTests
2
7
CrossTranslationUnitTest.cpp
3
- CLANG_LIBS
8
+ )
9
+
10
+ clang_target_link_libraries (CrossTUTests
11
+ PRIVATE
4
12
clangAST
5
13
clangBasic
6
14
clangCrossTU
7
15
clangFrontend
8
16
clangSerialization
9
17
clangTooling
10
- LLVM_COMPONENTS
11
- Support
12
18
)
Original file line number Diff line number Diff line change 1
1
if (APPLE OR CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME STREQUAL Windows )
2
2
3
+ set (LLVM_LINK_COMPONENTS
4
+ Support
5
+ )
6
+
3
7
add_clang_unittest (DirectoryWatcherTests
4
8
DirectoryWatcherTest.cpp
5
- LINK_LIBS
9
+ )
10
+
11
+ target_link_libraries (DirectoryWatcherTests
12
+ PRIVATE
6
13
LLVMTestingSupport
7
14
clangDirectoryWatcher
8
- LLVM_COMPONENTS
9
- Support
10
15
)
11
16
12
17
endif ()
Original file line number Diff line number Diff line change
1
+ set (LLVM_LINK_COMPONENTS
2
+ ${LLVM_TARGETS_TO_BUILD}
3
+ MC
4
+ Option
5
+ Support
6
+ TargetParser
7
+ )
8
+
1
9
add_clang_unittest (ClangDriverTests
2
10
DistroTest.cpp
3
11
DXCModeTest.cpp
@@ -7,15 +15,12 @@ add_clang_unittest(ClangDriverTests
7
15
MultilibBuilderTest.cpp
8
16
MultilibTest.cpp
9
17
SanitizerArgsTest.cpp
10
- CLANG_LIBS
18
+ )
19
+
20
+ clang_target_link_libraries (ClangDriverTests
21
+ PRIVATE
11
22
clangDriver
12
23
clangBasic
13
24
clangFrontend # For TextDiagnosticPrinter.
14
25
clangSerialization
15
- LLVM_COMPONENTS
16
- ${LLVM_TARGETS_TO_BUILD}
17
- MC
18
- Option
19
- Support
20
- TargetParser
21
26
)
You can’t perform that action at this time.
0 commit comments