tests: Fix to find right vulkan library on Windows
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 37efeb8..8363c94 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -38,33 +38,33 @@
${ImageMagick_LIBRARIES}
)
-add_library(glslang STATIC IMPORTED)
-add_library(OGLCompiler STATIC IMPORTED)
-add_library(OSDependent STATIC IMPORTED)
-add_library(SPIRV STATIC IMPORTED)
-
-# On Windows, we must pair Debug and Release appropriately
-if (WIN32)
- set_target_properties(glslang PROPERTIES
- IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/glslang/Release/glslang.lib"
- IMPORTED_LOCATION_DEBUG "${GLSLANG_PREFIX}/build/glslang/Debug/glslang.lib")
- set_target_properties(OGLCompiler PROPERTIES
- IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/OGLCompilersDLL/Release/OGLCompiler.lib"
+add_library(glslang STATIC IMPORTED)
+add_library(OGLCompiler STATIC IMPORTED)
+add_library(OSDependent STATIC IMPORTED)
+add_library(SPIRV STATIC IMPORTED)
+
+# On Windows, we must pair Debug and Release appropriately
+if (WIN32)
+ set_target_properties(glslang PROPERTIES
+ IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/glslang/Release/glslang.lib"
+ IMPORTED_LOCATION_DEBUG "${GLSLANG_PREFIX}/build/glslang/Debug/glslang.lib")
+ set_target_properties(OGLCompiler PROPERTIES
+ IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/OGLCompilersDLL/Release/OGLCompiler.lib"
IMPORTED_LOCATION_DEBUG "${GLSLANG_PREFIX}/build/OGLCompilersDLL/Debug/OGLCompiler.lib")
- set_target_properties(OSDependent PROPERTIES
- IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/glslang/OSDependent/Windows/Release/OSDependent.lib"
+ set_target_properties(OSDependent PROPERTIES
+ IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/glslang/OSDependent/Windows/Release/OSDependent.lib"
IMPORTED_LOCATION_DEBUG "${GLSLANG_PREFIX}/build/glslang/OSDependent/Windows/Debug/OSDependent.lib")
- set_target_properties(SPIRV PROPERTIES
- IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/SPIRV/Release/SPIRV.lib"
+ set_target_properties(SPIRV PROPERTIES
+ IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/SPIRV/Release/SPIRV.lib"
IMPORTED_LOCATION_DEBUG "${GLSLANG_PREFIX}/build/SPIRV/Debug/SPIRV.lib")
else ()
- set_target_properties(glslang PROPERTIES
- IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/install/lib/libglslang.a")
- set_target_properties(OGLCompiler PROPERTIES
+ set_target_properties(glslang PROPERTIES
+ IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/install/lib/libglslang.a")
+ set_target_properties(OGLCompiler PROPERTIES
IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/install/lib/libOGLCompiler.a")
- set_target_properties(OSDependent PROPERTIES
+ set_target_properties(OSDependent PROPERTIES
IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/install/lib/libOSDependent.a")
- set_target_properties(SPIRV PROPERTIES
+ set_target_properties(SPIRV PROPERTIES
IMPORTED_LOCATION "${GLSLANG_PREFIX}/build/install/lib/libSPIRV.a")
endif()
@@ -106,34 +106,40 @@
endif()
endif()
+if (WIN32)
+ set (LIBVK "vulkan.${MAJOR}")
+else ()
+ set (LIBVK "vulkan")
+endif()
+
add_executable(vkbase init.cpp ${COMMON_CPP})
set_target_properties(vkbase
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-target_link_libraries(vkbase vulkan gtest gtest_main ${TEST_LIBRARIES})
+target_link_libraries(vkbase ${LIBVK} gtest gtest_main ${TEST_LIBRARIES})
add_executable(vk_image_tests image_tests.cpp ${COMMON_CPP})
set_target_properties(vk_image_tests
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-target_link_libraries(vk_image_tests vulkan gtest gtest_main ${TEST_LIBRARIES})
+target_link_libraries(vk_image_tests ${LIBVK} gtest gtest_main ${TEST_LIBRARIES})
add_executable(vk_render_tests render_tests.cpp ${COMMON_CPP})
set_target_properties(vk_render_tests
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-target_link_libraries(vk_render_tests vulkan gtest gtest_main ${TEST_LIBRARIES})
+target_link_libraries(vk_render_tests ${LIBVK} gtest gtest_main ${TEST_LIBRARIES})
add_executable(vk_blit_tests blit_tests.cpp ${COMMON_CPP})
set_target_properties(vk_blit_tests
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-target_link_libraries(vk_blit_tests vulkan gtest gtest_main ${TEST_LIBRARIES})
+target_link_libraries(vk_blit_tests ${LIBVK} gtest gtest_main ${TEST_LIBRARIES})
add_executable(vk_layer_validation_tests layer_validation_tests.cpp ${COMMON_CPP})
set_target_properties(vk_layer_validation_tests
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-target_link_libraries(vk_layer_validation_tests vulkan gtest gtest_main layer_utils ${TEST_LIBRARIES})
+target_link_libraries(vk_layer_validation_tests ${LIBVK} gtest gtest_main layer_utils ${TEST_LIBRARIES})
add_subdirectory(gtest-1.7.0)