From bc01362368c4236b392f6dd20a95b21b73c2aed6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Aug 2022 09:46:46 -0400 Subject: FindVulkan: Restore tolerance of unknown FATAL_ERROR component `find_package(Vulkan REQUIRED FATAL_ERROR)` calls exist in the wild, but `find_package` does not have a `FATAL_ERROR` option. We silently tolerated such calls prior to commit 6e4d20921d (FindVulkan: Add component for `shaderc_combined`, 2022-05-18, v3.24.0-rc1~111^2~5), by treating the argument as a component and ignoring it. Restore tolerance by removing the component and warning about it. Fixes: #23849 --- Modules/FindVulkan.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 2c70227..7ca7d03 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -172,6 +172,16 @@ environment. cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) +# Provide compatibility with a common invalid component request that +# was silently ignored prior to CMake 3.24. +if("FATAL_ERROR" IN_LIST Vulkan_FIND_COMPONENTS) + message(AUTHOR_WARNING + "Ignoring unknown component 'FATAL_ERROR'.\n" + "The find_package() command documents no such argument." + ) + list(REMOVE_ITEM Vulkan_FIND_COMPONENTS "FATAL_ERROR") +endif() + # For backward compatibility as `FindVulkan` in previous CMake versions allow to retrieve `glslc` # and `glslangValidator` without requesting the corresponding component. if(NOT glslc IN_LIST Vulkan_FIND_COMPONENTS) -- cgit v0.12 From 9063674517e4244155f8286c2106dfb2707be0f4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Aug 2022 09:52:14 -0400 Subject: Help: Add 3.24 release note about FindVulkan component enforcement Since commit 6e4d20921d (FindVulkan: Add component for `shaderc_combined`, 2022-05-18, v3.24.0-rc1~111^2~5), the module rejects unknown components. Add a release note about this behavior change. Issue: #23849 --- Help/release/3.24.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Help/release/3.24.rst b/Help/release/3.24.rst index 3141255..7db9c91 100644 --- a/Help/release/3.24.rst +++ b/Help/release/3.24.rst @@ -317,6 +317,11 @@ Deprecated and Removed Features * The :module:`FindGLUT` module no longer provides the undocumented ``GLUT_LIBRARY`` and ``GLUT_INCLUDE_PATH`` result variables. +* The :module:`FindVulkan` module no longer silently ignores unknown + components requested by a ``find_package(Vulkan REQUIRED ...)`` call. + With the addition of support for components, requests for unknown + components now produce an error. + Other Changes ============= -- cgit v0.12