From b832767940698a7dc7a347e8643edd717747787d Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Tue, 6 Feb 2024 20:18:21 -0700 Subject: Tests/FindVulkan: Update for glslang 12.3+ output Since 12.3.0 glslangValidator has been renamed to glslang. This fix maintains backcompat with older SDKs --- Tests/FindVulkan/Test/Run-glslangValidator.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tests/FindVulkan/Test/Run-glslangValidator.cmake b/Tests/FindVulkan/Test/Run-glslangValidator.cmake index 27fd950..fd7867f 100644 --- a/Tests/FindVulkan/Test/Run-glslangValidator.cmake +++ b/Tests/FindVulkan/Test/Run-glslangValidator.cmake @@ -11,8 +11,10 @@ function(run_glslangValidator exe exe_display) message(SEND_ERROR "Result of ${exe_display} --help is ${result}, should be 1") endif() - if(NOT output MATCHES "^Usage: glslangValidator") - message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"Usage: glslangValidator\"") + # NOTE: Newer version prefer just "glslang" since it's no longer really just a validator. + # This approach is still compatible with older version that output glslangValidator + if(NOT output MATCHES "^Usage: glslang") + message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"Usage: glslang\"") endif() endfunction() -- cgit v0.12 From 9cefa2f08dd9cd41a133c1120fd0d53d15b6b665 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Tue, 6 Feb 2024 20:23:19 -0700 Subject: Tests/FindVulkan: Allow easy way to switch between VulkanSDK installations Running with `--fresh` resets the cache each time. Which is valuable for switching between SDK installations. --- Tests/FindVulkan/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/FindVulkan/CMakeLists.txt b/Tests/FindVulkan/CMakeLists.txt index 46ce1c6..d7c99ce 100644 --- a/Tests/FindVulkan/CMakeLists.txt +++ b/Tests/FindVulkan/CMakeLists.txt @@ -5,6 +5,7 @@ add_test(NAME FindVulkan.Test COMMAND "${CMake_BINARY_DIR}/Tests/FindVulkan/Test" ${build_generator_args} --build-project TestFindVulkan - --build-options ${build_options} + # Use --fresh to make testing multiple SDK versions on the same computer easier + --build-options ${build_options} --fresh --test-command ${CMAKE_CTEST_COMMAND} -V -C $ ) -- cgit v0.12 From 49ebf18dd0f36519713241fc386a8c05077d0b11 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Tue, 6 Feb 2024 20:16:52 -0700 Subject: FindVulkan: Update detection for glslang 14.0.0 Allow `oglcompiler`, `osdependent`, `machineindependent`, and `genericcodegen` to be optional static library components. Fixes: #25583 --- Modules/FindVulkan.cmake | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 581763d..0f45b63 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -537,13 +537,7 @@ _Vulkan_set_library_component_found(glslang-oglcompiler NO_WARNING) _Vulkan_set_library_component_found(glslang-osdependent NO_WARNING) _Vulkan_set_library_component_found(glslang-machineindependent NO_WARNING) _Vulkan_set_library_component_found(glslang-genericcodegen NO_WARNING) -_Vulkan_set_library_component_found(glslang - DEPENDENT_COMPONENTS - glslang-spirv - glslang-oglcompiler - glslang-osdependent - glslang-machineindependent - glslang-genericcodegen) +_Vulkan_set_library_component_found(glslang DEPENDENT_COMPONENTS glslang-spirv) _Vulkan_set_library_component_found(shaderc_combined) _Vulkan_set_library_component_found(SPIRV-Tools) _Vulkan_set_library_component_found(volk) @@ -747,10 +741,6 @@ if(Vulkan_FOUND) if((Vulkan_glslang_LIBRARY OR Vulkan_glslang_DEBUG_LIBRARY) AND TARGET Vulkan::glslang-spirv - AND TARGET Vulkan::glslang-oglcompiler - AND TARGET Vulkan::glslang-osdependent - AND TARGET Vulkan::glslang-machineindependent - AND TARGET Vulkan::glslang-genericcodegen AND NOT TARGET Vulkan::glslang) add_library(Vulkan::glslang STATIC IMPORTED) set_property(TARGET Vulkan::glslang @@ -775,10 +765,13 @@ if(Vulkan_FOUND) target_link_libraries(Vulkan::glslang INTERFACE Vulkan::glslang-spirv - Vulkan::glslang-oglcompiler - Vulkan::glslang-osdependent - Vulkan::glslang-machineindependent - Vulkan::glslang-genericcodegen + # OGLCompiler library has been fully removed since version 14.0.0 + # OSDependent, MachineIndependent, and GenericCodeGen may also be removed in the future. + # See https://github.com/KhronosGroup/glslang/issues/3462 + $ + $ + $ + $ ) endif() -- cgit v0.12