summaryrefslogtreecommitdiffstats
path: root/Tests/FindVulkan
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindVulkan')
-rw-r--r--Tests/FindVulkan/Test/CMakeLists.txt18
-rw-r--r--Tests/FindVulkan/Test/main-shaderc_combined.cxx14
2 files changed, 30 insertions, 2 deletions
diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt
index 7ae8a11..005497c 100644
--- a/Tests/FindVulkan/Test/CMakeLists.txt
+++ b/Tests/FindVulkan/Test/CMakeLists.txt
@@ -1,9 +1,12 @@
cmake_minimum_required(VERSION 3.4)
+cmake_policy(SET CMP0091 NEW)
project(TestFindVulkan C CXX)
include(CTest)
-SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../)
-find_package(Vulkan REQUIRED)
+SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../Modules)
+find_package(Vulkan REQUIRED
+ COMPONENTS
+ shaderc_combined)
add_executable(test_tgt main.c)
target_link_libraries(test_tgt Vulkan::Vulkan)
@@ -23,6 +26,17 @@ target_include_directories(test_var_dl PRIVATE ${Vulkan_INCLUDE_DIRS})
target_link_libraries(test_var_dl ${CMAKE_DL_LIBS})
add_test(NAME test_var_dl COMMAND test_var_dl)
+add_executable(test_tgt_shaderc_combined main-shaderc_combined.cxx)
+target_link_libraries(test_tgt_shaderc_combined Vulkan::shaderc_combined)
+add_test(NAME test_tgt_shaderc_combined COMMAND test_tgt_shaderc_combined)
+
+get_property(shaderc_combined_debug_location TARGET Vulkan::shaderc_combined PROPERTY IMPORTED_LOCATION_DEBUG)
+if(NOT shaderc_combined_debug_location)
+ set_property(TARGET test_tgt_shaderc_combined
+ PROPERTY
+ MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
+endif()
+
if(Vulkan_GLSLC_EXECUTABLE)
add_test(NAME test_glslc
COMMAND ${CMAKE_COMMAND}
diff --git a/Tests/FindVulkan/Test/main-shaderc_combined.cxx b/Tests/FindVulkan/Test/main-shaderc_combined.cxx
new file mode 100644
index 0000000..30449fb
--- /dev/null
+++ b/Tests/FindVulkan/Test/main-shaderc_combined.cxx
@@ -0,0 +1,14 @@
+#include <assert.h>
+#include <shaderc/shaderc.h>
+#include <stdio.h>
+
+int main()
+{
+ unsigned int shaderc_version, shaderc_revision;
+ shaderc_get_spv_version(&shaderc_version, &shaderc_revision);
+
+ printf("shaderc version: %u (revision: %u)", shaderc_version,
+ shaderc_revision);
+
+ return 0;
+}