Skip to content

Commit a8d742a

Browse files
authored
Create LLVM_COMPONENTS_TO_LINK, LLVM_LIBS_TO_LINK and CLANG_LIBS_TO_LINK to simplify PR
1 parent 8047a56 commit a8d742a

File tree

1 file changed

+41
-29
lines changed

1 file changed

+41
-29
lines changed

clang/unittests/Interpreter/CMakeLists.txt

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,54 @@
11
if(EMSCRIPTEN)
2+
set(LLVM_COMPONENTS_TO_LINK
3+
""
4+
)
5+
set(LLVM_LIBS_TO_LINK
6+
""
7+
)
8+
set(CLANG_LIBS_TO_LINK
9+
clangInterpreter
10+
)
11+
else()
12+
set(LLVM_COMPONENTS_TO_LINK
13+
${LLVM_TARGETS_TO_BUILD}
14+
Core
15+
MC
16+
OrcJIT
17+
Support
18+
TargetParser
19+
)
20+
set(LLVM_LIBS_TO_LINK
21+
LLVMTestingSupport
22+
)
23+
set(CLANG_LIBS_TO_LINK
24+
clangAST
25+
clangBasic
26+
clangInterpreter
27+
clangFrontend
28+
clangSema
29+
)
30+
endif()
31+
232
add_distinct_clang_unittest(ClangReplInterpreterTests
333
IncrementalCompilerBuilderTest.cpp
434
IncrementalProcessingTest.cpp
535
InterpreterTest.cpp
636
InterpreterExtensionsTest.cpp
737
CodeCompletionTest.cpp
838

39+
EXPORT_SYMBOLS
40+
941
CLANG_LIBS
10-
clangInterpreter
42+
${CLANG_LIBS_TO_LINK}
43+
44+
LINK_LIBS
45+
${LLVM_LIBS_TO_LINK}
46+
47+
LLVM_COMPONENTS
48+
${LLVM_COMPONENTS_TO_LINK}
1149
)
50+
51+
if(EMSCRIPTEN)
1252
target_link_options(ClangReplInterpreterTests
1353
PUBLIC "SHELL: -s MAIN_MODULE=1"
1454
PUBLIC "SHELL: -s ALLOW_MEMORY_GROWTH=1"
@@ -19,34 +59,6 @@ target_link_options(ClangReplInterpreterTests
1959
set_target_properties(ClangReplInterpreterTests PROPERTIES
2060
SUFFIX ".html"
2161
)
22-
else()
23-
add_distinct_clang_unittest(ClangReplInterpreterTests
24-
IncrementalCompilerBuilderTest.cpp
25-
IncrementalProcessingTest.cpp
26-
InterpreterTest.cpp
27-
InterpreterExtensionsTest.cpp
28-
CodeCompletionTest.cpp
29-
30-
EXPORT_SYMBOLS
31-
32-
CLANG_LIBS
33-
clangAST
34-
clangBasic
35-
clangInterpreter
36-
clangFrontend
37-
clangSema
38-
39-
LINK_LIBS
40-
LLVMTestingSupport
41-
42-
LLVM_COMPONENTS
43-
${LLVM_TARGETS_TO_BUILD}
44-
Core
45-
MC
46-
OrcJIT
47-
Support
48-
TargetParser
49-
)
5062
endif()
5163

5264
# Exceptions on Windows are not yet supported.

0 commit comments

Comments
 (0)