diff options
author | MACHIZAUD Andréa <andrea.machizaud@gmail.com> | 2022-05-22 22:16:32 (GMT) |
---|---|---|
committer | MACHIZAUD Andréa <andrea.machizaud@gmail.com> | 2022-05-22 22:16:32 (GMT) |
commit | d9b4264cb848b61975fe7213183356961f0e0759 (patch) | |
tree | b4481648e7ec4f2dfe3bcd74778adbb2430e1de4 /Tests | |
parent | 10a6bb16bb91738f3fad0828dd0accbaf1dc7424 (diff) | |
download | CMake-d9b4264cb848b61975fe7213183356961f0e0759.zip CMake-d9b4264cb848b61975fe7213183356961f0e0759.tar.gz CMake-d9b4264cb848b61975fe7213183356961f0e0759.tar.bz2 |
FindVulkan: Add component for `MoltenVK`
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindVulkan/Test/CMakeLists.txt | 19 | ||||
-rw-r--r-- | Tests/FindVulkan/Test/main-MoltenVK.cxx | 16 |
2 files changed, 31 insertions, 4 deletions
diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt index e0c358f..42543ac 100644 --- a/Tests/FindVulkan/Test/CMakeLists.txt +++ b/Tests/FindVulkan/Test/CMakeLists.txt @@ -3,11 +3,16 @@ cmake_policy(SET CMP0091 NEW) project(TestFindVulkan C CXX) include(CTest) +set(components + glslang + shaderc_combined + SPIRV-Tools +) +if(APPLE) + list(APPEND components MoltenVK) +endif() find_package(Vulkan REQUIRED - COMPONENTS - glslang - shaderc_combined - SPIRV-Tools) + COMPONENTS ${components}) add_executable(test_tgt main.c) target_link_libraries(test_tgt Vulkan::Vulkan) @@ -64,6 +69,12 @@ if(NOT SPIRV-Tools_debug_location) MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") endif() +if(APPLE) + add_executable(test_tgt_MoltenVK main-MoltenVK.cxx) + target_link_libraries(test_tgt_MoltenVK Vulkan::MoltenVK) + add_test(NAME test_tgt_MoltenVK COMMAND test_tgt_MoltenVK) +endif() + if(Vulkan_GLSLC_EXECUTABLE) add_test(NAME test_glslc COMMAND ${CMAKE_COMMAND} diff --git a/Tests/FindVulkan/Test/main-MoltenVK.cxx b/Tests/FindVulkan/Test/main-MoltenVK.cxx new file mode 100644 index 0000000..3156979 --- /dev/null +++ b/Tests/FindVulkan/Test/main-MoltenVK.cxx @@ -0,0 +1,16 @@ +#include <iostream> + +#include <MoltenVK/vk_mvk_moltenvk.h> + +int main() +{ + char mvk_version[256]; + char vk_version[256]; + vkGetVersionStringsMVK(mvk_version, sizeof(mvk_version), vk_version, + sizeof(vk_version)); + + std::cout << "MoltenVK version: " << mvk_version << std::endl; + std::cout << "Vulkan version: " << vk_version << std::endl; + + return 0; +} |