1set(SAFESTACK_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
2set(SAFESTACK_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
3
4set(SAFESTACK_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
5if(NOT COMPILER_RT_STANDALONE_BUILD)
6  list(APPEND SAFESTACK_TEST_DEPS safestack)
7
8  # Some tests require LTO, so add a dependency on the relevant LTO plugin.
9  if(LLVM_ENABLE_PIC)
10    if(LLVM_BINUTILS_INCDIR)
11      list(APPEND SAFESTACK_TEST_DEPS
12        LLVMgold
13      )
14    endif()
15    if(APPLE)
16      list(APPEND SAFESTACK_TEST_DEPS
17        LTO
18      )
19    endif()
20  endif()
21endif()
22
23configure_lit_site_cfg(
24  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
25  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
26  )
27
28add_lit_testsuite(check-safestack "Running the SafeStack tests"
29  ${CMAKE_CURRENT_BINARY_DIR}
30  DEPENDS ${SAFESTACK_TEST_DEPS})
31set_target_properties(check-safestack PROPERTIES FOLDER "Compiler-RT Misc")
32