
macro(add_compilation_test name)
  if(MDSPAN_TEST_LANGUAGE)
    set_source_files_properties(${name} PROPERTIES LANGUAGE ${MDSPAN_TEST_LANGUAGE})
  endif()
  add_executable(${name} ${name}.cpp)
  target_link_libraries(${name} mdspan)
endmacro()

add_compilation_test(ctest_constructor_sfinae)
add_compilation_test(ctest_extents_ctors)
add_compilation_test(ctest_extents_type_check)
add_compilation_test(ctest_mdarray_type_check)
add_compilation_test(ctest_layout_type_check)
add_compilation_test(ctest_layout_convertible)
add_compilation_test(ctest_mdspan_convertible)
add_compilation_test(ctest_standard_layout)
add_compilation_test(ctest_trivially_copyable)
if(NOT MDSPAN_ENABLE_CUDA)
  add_compilation_test(ctest_no_unique_address)
  add_compilation_test(ctest_compressed_pair_layout)
endif()
add_compilation_test(ctest_constexpr_dereference)
if(NOT CMAKE_CXX_STANDARD STREQUAL "14")
add_compilation_test(ctest_constexpr_submdspan)
endif()
add_compilation_test(ctest_constexpr_layouts)
add_compilation_test(ctest_namespace_std)
