summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-08 14:44:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-02-08 14:45:02 (GMT)
commit504d33b603972aefbc4c79492684c1e7b3b4e88e (patch)
tree737d56b69891bb6ba34e2d348311792c4c7010e4
parentd97cded93e059593fab56bfaad39f075606f9184 (diff)
parent49ebf18dd0f36519713241fc386a8c05077d0b11 (diff)
downloadCMake-504d33b603972aefbc4c79492684c1e7b3b4e88e.zip
CMake-504d33b603972aefbc4c79492684c1e7b3b4e88e.tar.gz
CMake-504d33b603972aefbc4c79492684c1e7b3b4e88e.tar.bz2
Merge topic 'FindVulkan-glslang-14' into release-3.29
49ebf18dd0 FindVulkan: Update detection for glslang 14.0.0 9cefa2f08d Tests/FindVulkan: Allow easy way to switch between VulkanSDK installations b832767940 Tests/FindVulkan: Update for glslang 12.3+ output Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9225
-rw-r--r--Modules/FindVulkan.cmake23
-rw-r--r--Tests/FindVulkan/CMakeLists.txt3
-rw-r--r--Tests/FindVulkan/Test/Run-glslangValidator.cmake6
3 files changed, 14 insertions, 18 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
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-oglcompiler>
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-osdependent>
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-machineindependent>
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-genericcodegen>
)
endif()
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 $<CONFIGURATION>
)
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()