File: CMakeLists.txt

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (45 lines) | stat: -rw-r--r-- 1,799 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
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
   OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
  libomptarget_say("Can only test with Clang compiler in version 6.0.0 or later.")
  libomptarget_warning_say("The check-libomptarget target will not be available!")
  return()
endif()

if(LIBOMPTARGET_ENABLE_DEBUG)
  set(LIBOMPTARGET_DEBUG True)
else()
  set(LIBOMPTARGET_DEBUG False)
endif()

# Replace the space from user's input with ";" in case that CMake add escape
# char into the lit command.
string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")

string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
  string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)

  add_openmp_testsuite(check-libomptarget-${CURRENT_TARGET}
    "Running libomptarget tests"
    ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
    DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
    ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
  list(APPEND LIBOMPTARGET_LIT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET})

  # Configure the lit.site.cfg.in file
  set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!")
  get_filename_component(CUDA_LIBDIR "${CUDA_cudart_static_LIBRARY}" DIRECTORY)
  configure_file(lit.site.cfg.in ${CURRENT_TARGET}/lit.site.cfg @ONLY)
endforeach()

if ("flang" IN_LIST LLVM_ENABLE_PROJECTS)
  SET(FORTRAN_TEST_DEPS flang-new)
endif()

add_openmp_testsuite(check-libomptarget
  "Running libomptarget tests"
  ${LIBOMPTARGET_LIT_TESTSUITES}
  EXCLUDE_FROM_CHECK_ALL
  DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS} ${FORTRAN_TEST_DEPS}
  ARGS ${LIBOMPTARGET_LIT_ARG_LIST})