xref: /llvm-project/clang/unittests/Interpreter/CMakeLists.txt (revision eb9af19fbf13b91c9df8d6dc8553277169976520)
1set(LLVM_LINK_COMPONENTS
2  ${LLVM_TARGETS_TO_BUILD}
3  Core
4  MC
5  OrcJIT
6  Support
7  TargetParser
8  )
9
10add_clang_unittest(ClangReplInterpreterTests
11  IncrementalCompilerBuilderTest.cpp
12  IncrementalProcessingTest.cpp
13  InterpreterTest.cpp
14  InterpreterExtensionsTest.cpp
15  CodeCompletionTest.cpp
16
17  EXPORT_SYMBOLS
18  )
19
20target_link_libraries(ClangReplInterpreterTests PUBLIC LLVMTestingSupport)
21
22clang_target_link_libraries(ClangReplInterpreterTests PRIVATE
23  clangAST
24  clangBasic
25  clangInterpreter
26  clangFrontend
27  clangSema
28  )
29
30# Exceptions on Windows are not yet supported.
31if(NOT WIN32)
32  add_subdirectory(ExceptionTests)
33endif()
34
35if(MSVC)
36  set_target_properties(ClangReplInterpreterTests PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)
37
38  # RTTI/C++ symbols
39  set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports} ??_7type_info@@6B@
40    ?__type_info_root_node@@3U__type_info_node@@A
41    ?nothrow@std@@3Unothrow_t@1@B
42  )
43
44  # Compiler added symbols for static variables. NOT for VStudio < 2015
45  set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports} _Init_thread_abort _Init_thread_epoch
46    _Init_thread_footer _Init_thread_header _tls_index
47  )
48
49  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
50    # new/delete variants needed when linking to static msvc runtime (esp. Debug)
51    set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports}
52      ??2@YAPEAX_K@Z
53      ??3@YAXPEAX@Z
54      ??_U@YAPEAX_K@Z
55      ??_V@YAXPEAX@Z
56      ??3@YAXPEAX_K@Z
57    )
58  else()
59    set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports}
60      ??2@YAPAXI@Z
61      ??3@YAXPAX@Z
62      ??3@YAXPAXI@Z
63      ??_U@YAPAXI@Z
64      ??_V@YAXPAX@Z
65      ??_V@YAXPAXI@Z
66    )
67  endif()
68
69  # List to '/EXPORT:sym0 /EXPORT:sym1 /EXPORT:sym2 ...'
70  list(TRANSFORM ClangReplInterpreterTests_exports PREPEND "LINKER:/EXPORT:")
71  set_property(TARGET ClangReplInterpreterTests APPEND PROPERTY LINK_OPTIONS ${ClangReplInterpreterTests_exports})
72
73endif(MSVC)
74