integration tests for cxx modules

This commit is contained in:
Jan Kuhlmann 2025-03-18 11:12:06 +01:00 committed by Charles Giessen
parent 78c359741d
commit 9417d66dcf
2 changed files with 18 additions and 3 deletions

View file

@ -6,15 +6,24 @@
# SPDX-License-Identifier: Apache-2.0
# ~~~
# Test add_subdirectory suppport
add_test(NAME integration.add_subdirectory
# Test add_subdirectory suppport for headers
add_test(NAME integration.add_subdirectory_headers
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_headers
--build-generator ${CMAKE_GENERATOR}
--build-options -DFIND_PACKAGE_TESTING=OFF -DVULKAN_HEADERS_ENABLE_MODULE=OFF
)
# Test add_subdirectory suppport for C++20 modules
add_test(NAME integration.add_subdirectory_modules
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test ${CMAKE_CURRENT_LIST_DIR}/integration
${CMAKE_CURRENT_BINARY_DIR}/add_subdirectory_modules
--build-generator ${CMAKE_GENERATOR}
--build-options -DFIND_PACKAGE_TESTING=OFF -DVULKAN_HEADERS_ENABLE_MODULE=ON
)
set(test_install_dir "${CMAKE_CURRENT_BINARY_DIR}/install")
add_test(NAME integration.install
COMMAND ${CMAKE_COMMAND} --install ${VULKAN_HEADERS_BINARY_DIR} --prefix ${test_install_dir} --config $<CONFIG>

View file

@ -18,6 +18,9 @@ endif()
if (NOT TARGET Vulkan::Headers)
message(FATAL_ERROR "Vulkan::Headers target not defined")
endif()
if (NOT TARGET Vulkan::HppModule AND VULKAN_HEADERS_ENABLE_MODULE)
message(FATAL_ERROR "Vulkan::HppModule target not defined")
endif()
if (FIND_PACKAGE_TESTING)
if (NOT DEFINED VulkanHeaders_VERSION)
@ -37,6 +40,9 @@ if (NOT FIND_PACKAGE_TESTING)
if (NOT TARGET Vulkan-Headers)
message(FATAL_ERROR "Backcompat for Vulkan-Headers target broken!")
endif()
if (NOT TARGET Vulkan-HppModule AND VULKAN_HEADERS_ENABLE_MODULE)
message(FATAL_ERROR "Backcompat for Vulkan-HppModule target broken!")
endif()
endif()
set(CMAKE_C_STANDARD 99)