diff options
author | Brad King <brad.king@kitware.com> | 2022-08-17 13:46:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-08-17 13:52:12 (GMT) |
commit | bc01362368c4236b392f6dd20a95b21b73c2aed6 (patch) | |
tree | 054f2b6e1f695c62e77e2b8d97d5aac4a22f9f6e /Modules/FindVulkan.cmake | |
parent | d3f58ea453907a171a4572ddb054ea98ddb5669e (diff) | |
download | CMake-bc01362368c4236b392f6dd20a95b21b73c2aed6.zip CMake-bc01362368c4236b392f6dd20a95b21b73c2aed6.tar.gz CMake-bc01362368c4236b392f6dd20a95b21b73c2aed6.tar.bz2 |
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
Diffstat (limited to 'Modules/FindVulkan.cmake')
-rw-r--r-- | Modules/FindVulkan.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
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) |