File: CMakeLists.txt

package info (click to toggle)
llvm-toolchain-snapshot 1%3A13~%2B%2B20210418105309%2Ba0898f0cecc7-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,180,760 kB
  • sloc: cpp: 5,125,598; ansic: 878,822; asm: 532,328; python: 182,254; objc: 71,880; lisp: 29,622; sh: 24,255; f90: 23,940; pascal: 9,361; perl: 7,481; ml: 5,432; awk: 3,523; makefile: 2,734; xml: 953; cs: 573; fortran: 539; javascript: 460
file content (74 lines) | stat: -rw-r--r-- 2,230 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Debug Info tests.  These tests invoke clang to generate programs with
# various types of debug info, and then run those programs under a debugger
# such as GDB or LLDB to verify the results.

find_package(Python3 COMPONENTS Interpreter)

add_llvm_executable(check-gdb-llvm-support
        llvm-prettyprinters/gdb/llvm-support.cpp
)
target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)

set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

set(DEBUGINFO_TEST_DEPS
  clang
  FileCheck
  count
  llvm-config
  llvm-objdump
  check-gdb-llvm-support
  not
  )

if ("mlir" IN_LIST LLVM_ENABLE_PROJECTS)
  add_llvm_executable(check-gdb-mlir-support
        llvm-prettyprinters/gdb/mlir-support.cpp
  )
  target_include_directories(check-gdb-mlir-support PRIVATE
                               ${LLVM_EXTERNAL_MLIR_SOURCE_DIR}/include
                               ${LLVM_BINARY_DIR}/tools/mlir/include)
  target_link_libraries(check-gdb-mlir-support PRIVATE MLIRIR)
  list(APPEND DEBUGINFO_TEST_DEPS check-gdb-mlir-support)
  set(MLIR_SOURCE_DIR  ${LLVM_EXTERNAL_MLIR_SOURCE_DIR})
endif()

if("compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS)
  # llgdb-tests/asan.c and other asan* files.
  if(TARGET asan)
    list(APPEND DEBUGINFO_TEST_DEPS asan)
  endif()
  # llgdb-tests/safestack.c
  if(TARGET safestack)
    list(APPEND DEBUGINFO_TEST_DEPS safestack)
  endif()
endif()
# Many dexter tests depend on lldb.
if("lldb" IN_LIST LLVM_ENABLE_PROJECTS)
  list(APPEND DEBUGINFO_TEST_DEPS lldb lldb-server)
endif()

# The Windows builder scripts pass -fuse-ld=lld.
if (WIN32)
  set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld)
endif()

configure_lit_site_cfg(
  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
  MAIN_CONFIG
  ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
  )

add_lit_testsuite(check-debuginfo "Running debug info integration tests"
  ${CMAKE_CURRENT_BINARY_DIR}
  DEPENDS ${DEBUGINFO_TEST_DEPS}
  )

# Add check-debuginfo-* targets.
add_lit_testsuites(DEBUGINFO ${CMAKE_CURRENT_SOURCE_DIR}
  DEPENDS ${DEBUGINFO_TEST_DEPS}
  )

set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")