• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1set(AOTI_ABI_CHECK_TEST_ROOT ${TORCH_ROOT}/test/cpp/aoti_abi_check)
2
3# Build the cpp gtest binary containing the cpp-only tests.
4set(AOTI_ABI_CHECK_TEST_SRCS
5  ${AOTI_ABI_CHECK_TEST_ROOT}/main.cpp
6  ${AOTI_ABI_CHECK_TEST_ROOT}/test_cast.cpp
7  ${AOTI_ABI_CHECK_TEST_ROOT}/test_dtype.cpp
8  ${AOTI_ABI_CHECK_TEST_ROOT}/test_math.cpp
9  ${AOTI_ABI_CHECK_TEST_ROOT}/test_rand.cpp
10  ${AOTI_ABI_CHECK_TEST_ROOT}/test_vec.cpp
11)
12
13add_executable(test_aoti_abi_check
14  ${AOTI_ABI_CHECK_TEST_SRCS}
15)
16
17# TODO temporary until we can delete the old gtest polyfills.
18target_compile_definitions(test_aoti_abi_check PRIVATE USE_GTEST)
19
20# WARNING: DO NOT LINK torch!!!
21# The purpose is to check if the used aten/c10 headers are writtern in a header-only way
22target_link_libraries(test_aoti_abi_check PRIVATE gtest)
23target_include_directories(test_aoti_abi_check PRIVATE ${ATen_CPU_INCLUDE})
24
25if(INSTALL_TEST)
26  install(TARGETS test_aoti_abi_check DESTINATION bin)
27  # Install PDB files for MSVC builds
28  if(MSVC AND BUILD_SHARED_LIBS)
29    install(FILES $<TARGET_PDB_FILE:test_aoti_abi_check> DESTINATION bin OPTIONAL)
30  endif()
31endif()
32