From 08a420af4a5083367550c222e7aa243ac2d1fc18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Fri, 13 May 2022 23:09:05 +0200 Subject: FindVulkan: Factorize code for library/executable search --- Modules/FindVulkan.cmake | 107 +++++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 51 deletions(-) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 527ca8b..8d1634a 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -77,62 +77,62 @@ environment. #]=======================================================================] if(WIN32) - find_path(Vulkan_INCLUDE_DIR - NAMES vulkan/vulkan.h - HINTS - "$ENV{VULKAN_SDK}/Include" - ) - + set(_Vulkan_library_name vulkan-1) + set(_Vulkan_hint_include_search_paths + "$ENV{VULKAN_SDK}/Include" + ) if(CMAKE_SIZEOF_VOID_P EQUAL 8) - find_library(Vulkan_LIBRARY - NAMES vulkan-1 - HINTS - "$ENV{VULKAN_SDK}/Lib" - "$ENV{VULKAN_SDK}/Bin" - ) - find_program(Vulkan_GLSLC_EXECUTABLE - NAMES glslc - HINTS - "$ENV{VULKAN_SDK}/Bin" - ) - find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE - NAMES glslangValidator - HINTS - "$ENV{VULKAN_SDK}/Bin" - ) - elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) - find_library(Vulkan_LIBRARY - NAMES vulkan-1 - HINTS - "$ENV{VULKAN_SDK}/Lib32" - "$ENV{VULKAN_SDK}/Bin32" - ) - find_program(Vulkan_GLSLC_EXECUTABLE - NAMES glslc - HINTS - "$ENV{VULKAN_SDK}/Bin32" - ) - find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE - NAMES glslangValidator - HINTS - "$ENV{VULKAN_SDK}/Bin32" - ) + set(_Vulkan_hint_executable_search_paths + "$ENV{VULKAN_SDK}/Bin" + ) + set(_Vulkan_hint_library_search_paths + "$ENV{VULKAN_SDK}/Lib" + "$ENV{VULKAN_SDK}/Bin" + ) + else() + set(_Vulkan_hint_executable_search_paths + "$ENV{VULKAN_SDK}/Bin32" + ) + set(_Vulkan_hint_library_search_paths + "$ENV{VULKAN_SDK}/Lib32" + "$ENV{VULKAN_SDK}/Bin32" + ) endif() else() - find_path(Vulkan_INCLUDE_DIR - NAMES vulkan/vulkan.h - HINTS "$ENV{VULKAN_SDK}/include") - find_library(Vulkan_LIBRARY - NAMES vulkan - HINTS "$ENV{VULKAN_SDK}/lib") - find_program(Vulkan_GLSLC_EXECUTABLE - NAMES glslc - HINTS "$ENV{VULKAN_SDK}/bin") - find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE - NAMES glslangValidator - HINTS "$ENV{VULKAN_SDK}/bin") + set(_Vulkan_library_name vulkan) + set(_Vulkan_hint_include_search_paths + "$ENV{VULKAN_SDK}/include" + ) + set(_Vulkan_hint_executable_search_paths + "$ENV{VULKAN_SDK}/bin" + ) + set(_Vulkan_hint_library_search_paths + "$ENV{VULKAN_SDK}/lib" + ) endif() +find_path(Vulkan_INCLUDE_DIR + NAMES vulkan/vulkan.h + HINTS + ${_Vulkan_hint_include_search_paths} + ) + +find_library(Vulkan_LIBRARY + NAMES ${_Vulkan_library_name} + HINTS + ${_Vulkan_hint_library_search_paths} + ) +find_program(Vulkan_GLSLC_EXECUTABLE + NAMES glslc + HINTS + ${_Vulkan_hint_executable_search_paths} + ) +find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE + NAMES glslangValidator + HINTS + ${_Vulkan_hint_executable_search_paths} + ) + set(Vulkan_LIBRARIES ${Vulkan_LIBRARY}) set(Vulkan_INCLUDE_DIRS ${Vulkan_INCLUDE_DIR}) @@ -189,3 +189,8 @@ if(Vulkan_FOUND AND Vulkan_GLSLANG_VALIDATOR_EXECUTABLE AND NOT TARGET Vulkan::g add_executable(Vulkan::glslangValidator IMPORTED) set_property(TARGET Vulkan::glslangValidator PROPERTY IMPORTED_LOCATION "${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE}") endif() + +unset(_Vulkan_library_name) +unset(_Vulkan_hint_include_search_paths) +unset(_Vulkan_hint_executable_search_paths) +unset(_Vulkan_hint_library_search_paths) -- cgit v0.12 From 2f46b8d7237785fd3d4dac5085777f6279a6edb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Fri, 13 May 2022 23:12:29 +0200 Subject: FindVulkan: Move `mark_as_advanced` right after `find_*` calls. --- Modules/FindVulkan.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 8d1634a..2b514fa 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -116,22 +116,28 @@ find_path(Vulkan_INCLUDE_DIR HINTS ${_Vulkan_hint_include_search_paths} ) +mark_as_advanced(Vulkan_INCLUDE_DIR) find_library(Vulkan_LIBRARY NAMES ${_Vulkan_library_name} HINTS ${_Vulkan_hint_library_search_paths} ) +mark_as_advanced(Vulkan_LIBRARY) + find_program(Vulkan_GLSLC_EXECUTABLE NAMES glslc HINTS ${_Vulkan_hint_executable_search_paths} ) +mark_as_advanced(Vulkan_GLSLC_EXECUTABLE) + find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE NAMES glslangValidator HINTS ${_Vulkan_hint_executable_search_paths} ) +mark_as_advanced(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) set(Vulkan_LIBRARIES ${Vulkan_LIBRARY}) set(Vulkan_INCLUDE_DIRS ${Vulkan_INCLUDE_DIR}) @@ -164,9 +170,6 @@ find_package_handle_standard_args(Vulkan Vulkan_VERSION ) -mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY Vulkan_GLSLC_EXECUTABLE - Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) - if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan) add_library(Vulkan::Vulkan UNKNOWN IMPORTED) set_target_properties(Vulkan::Vulkan PROPERTIES -- cgit v0.12 From 6e4d20921d92458890837859ad36d1783331abc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Wed, 18 May 2022 23:15:48 +0200 Subject: FindVulkan: Add component for `shaderc_combined` --- Modules/FindVulkan.cmake | 97 +++++++++++++++++++++++++ Tests/FindVulkan/Test/CMakeLists.txt | 18 ++++- Tests/FindVulkan/Test/main-shaderc_combined.cxx | 14 ++++ 3 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 Tests/FindVulkan/Test/main-shaderc_combined.cxx diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 2b514fa..6c17b08 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -10,6 +10,14 @@ FindVulkan Find Vulkan, which is a low-overhead, cross-platform 3D graphics and computing API. +Optional COMPONENTS +^^^^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.24 + +This module respects several optional COMPONENTS: ``shaderc_combined``. There +are corresponding import targets for each of these flags. + IMPORTED Targets ^^^^^^^^^^^^^^^^ @@ -36,6 +44,12 @@ This module defines :prop_tgt:`IMPORTED` targets if Vulkan has been found: The glslangValidator tool, if found. It is used to compile GLSL and HLSL shaders into SPIR-V. +``Vulkan::shaderc_combined`` + .. versionadded:: 3.24 + + Defined if SDK has the Google static library for Vulkan shader compilation + (shaderc_combined). + Result Variables ^^^^^^^^^^^^^^^^ @@ -51,6 +65,13 @@ This module defines the following variables: .. versionadded:: 3.23 value from ``vulkan/vulkan_core.h`` +``Vulkan_shaderc_combined_FOUND`` + .. versionadded:: 3.24 + + True, if the SDK has the shaderc_combined library. + +.. versionadded:: 3.24 + Variables for component library ``shaderc_combined``. The module will also defines these cache variables: @@ -62,6 +83,10 @@ The module will also defines these cache variables: the path to the GLSL SPIR-V compiler ``Vulkan_GLSLANG_VALIDATOR_EXECUTABLE`` the path to the glslangValidator tool +``Vulkan_shaderc_combined_LIBRARY`` + .. versionadded:: 3.24 + + Path to the shaderc_combined library. Hints ^^^^^ @@ -139,6 +164,45 @@ find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE ) mark_as_advanced(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) +if(shaderc_combined IN_LIST Vulkan_FIND_COMPONENTS) + find_library(Vulkan_shaderc_combined_LIBRARY + NAMES shaderc_combined + HINTS + ${_Vulkan_hint_library_search_paths}) + mark_as_advanced(Vulkan_shaderc_combined_LIBRARY) + + find_library(Vulkan_shaderc_combined_DEBUG_LIBRARY + NAMES shaderc_combinedd + HINTS + ${_Vulkan_hint_library_search_paths}) + mark_as_advanced(Vulkan_shaderc_combined_DEBUG_LIBRARY) +endif() + +function(_Vulkan_set_library_component_found component) + if(Vulkan_${component}_LIBRARY OR Vulkan_${component}_DEBUG_LIBRARY) + set(Vulkan_${component}_FOUND TRUE PARENT_SCOPE) + + # For Windows Vulkan SDK, third party tools binaries are provided with different MSVC ABI: + # - Release binaries uses a runtime library + # - Debug binaries uses a debug runtime library + # This lead to incompatibilities in linking for some configuration types due to CMake-default or project-configured selected MSVC ABI. + if(WIN32) + if(NOT Vulkan_${component}_LIBRARY) + message(WARNING +"Library ${component} for Release configuration is missing, imported target Vulkan::${component} may not be able to link when targeting this build configuration due to incompatible MSVC ABI.") + endif() + if(NOT Vulkan_${component}_DEBUG_LIBRARY) + message(WARNING +"Library ${component} for Debug configuration is missing, imported target Vulkan::${component} may not be able to link when targeting this build configuration due to incompatible MSVC ABI. Consider re-installing the Vulkan SDK and request debug libraries to fix this warning.") + endif() + endif() + else() + set(Vulkan_${component}_FOUND FALSE PARENT_SCOPE) + endif() +endfunction() + +_Vulkan_set_library_component_found(shaderc_combined) + set(Vulkan_LIBRARIES ${Vulkan_LIBRARY}) set(Vulkan_INCLUDE_DIRS ${Vulkan_INCLUDE_DIR}) @@ -168,6 +232,7 @@ find_package_handle_standard_args(Vulkan Vulkan_INCLUDE_DIR VERSION_VAR Vulkan_VERSION + HANDLE_COMPONENTS ) if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan) @@ -193,6 +258,38 @@ if(Vulkan_FOUND AND Vulkan_GLSLANG_VALIDATOR_EXECUTABLE AND NOT TARGET Vulkan::g set_property(TARGET Vulkan::glslangValidator PROPERTY IMPORTED_LOCATION "${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE}") endif() +if(Vulkan_FOUND) + if((Vulkan_shaderc_combined_LIBRARY OR Vulkan_shaderc_combined_DEBUG_LIBRARY) AND NOT TARGET Vulkan::shaderc_combined) + add_library(Vulkan::shaderc_combined STATIC IMPORTED) + set_property(TARGET Vulkan::shaderc_combined + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_shaderc_combined_LIBRARY) + set_property(TARGET Vulkan::shaderc_combined APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::shaderc_combined + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_shaderc_combined_LIBRARY}") + endif() + if(Vulkan_shaderc_combined_DEBUG_LIBRARY) + set_property(TARGET Vulkan::shaderc_combined APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::shaderc_combined + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_shaderc_combined_DEBUG_LIBRARY}") + endif() + + if(UNIX) + find_package(Threads REQUIRED) + target_link_libraries(Vulkan::shaderc_combined + INTERFACE + Threads::Threads) + endif() + endif() +endif() + unset(_Vulkan_library_name) unset(_Vulkan_hint_include_search_paths) unset(_Vulkan_hint_executable_search_paths) diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt index 7ae8a11..005497c 100644 --- a/Tests/FindVulkan/Test/CMakeLists.txt +++ b/Tests/FindVulkan/Test/CMakeLists.txt @@ -1,9 +1,12 @@ cmake_minimum_required(VERSION 3.4) +cmake_policy(SET CMP0091 NEW) project(TestFindVulkan C CXX) include(CTest) -SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../) -find_package(Vulkan REQUIRED) +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../Modules) +find_package(Vulkan REQUIRED + COMPONENTS + shaderc_combined) add_executable(test_tgt main.c) target_link_libraries(test_tgt Vulkan::Vulkan) @@ -23,6 +26,17 @@ target_include_directories(test_var_dl PRIVATE ${Vulkan_INCLUDE_DIRS}) target_link_libraries(test_var_dl ${CMAKE_DL_LIBS}) add_test(NAME test_var_dl COMMAND test_var_dl) +add_executable(test_tgt_shaderc_combined main-shaderc_combined.cxx) +target_link_libraries(test_tgt_shaderc_combined Vulkan::shaderc_combined) +add_test(NAME test_tgt_shaderc_combined COMMAND test_tgt_shaderc_combined) + +get_property(shaderc_combined_debug_location TARGET Vulkan::shaderc_combined PROPERTY IMPORTED_LOCATION_DEBUG) +if(NOT shaderc_combined_debug_location) + set_property(TARGET test_tgt_shaderc_combined + PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") +endif() + if(Vulkan_GLSLC_EXECUTABLE) add_test(NAME test_glslc COMMAND ${CMAKE_COMMAND} diff --git a/Tests/FindVulkan/Test/main-shaderc_combined.cxx b/Tests/FindVulkan/Test/main-shaderc_combined.cxx new file mode 100644 index 0000000..30449fb --- /dev/null +++ b/Tests/FindVulkan/Test/main-shaderc_combined.cxx @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() +{ + unsigned int shaderc_version, shaderc_revision; + shaderc_get_spv_version(&shaderc_version, &shaderc_revision); + + printf("shaderc version: %u (revision: %u)", shaderc_version, + shaderc_revision); + + return 0; +} -- cgit v0.12 From 8d133f49e31d049b782dffaf2d444486f9461702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Wed, 18 May 2022 17:18:57 +0200 Subject: FindVulkan: Add component for `SPIRV-Tools` --- Modules/FindVulkan.cmake | 57 +++++++++++++++++++++++++++++--- Tests/FindVulkan/Test/CMakeLists.txt | 14 +++++++- Tests/FindVulkan/Test/main-SPIRV-Tools.c | 15 +++++++++ 3 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 Tests/FindVulkan/Test/main-SPIRV-Tools.c diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 6c17b08..8446c6c 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -15,8 +15,9 @@ Optional COMPONENTS .. versionadded:: 3.24 -This module respects several optional COMPONENTS: ``shaderc_combined``. There -are corresponding import targets for each of these flags. +This module respects several optional COMPONENTS: ``shaderc_combined`` and +``SPIRV-Tools``. There are corresponding import targets for each of these +flags. IMPORTED Targets ^^^^^^^^^^^^^^^^ @@ -50,6 +51,12 @@ This module defines :prop_tgt:`IMPORTED` targets if Vulkan has been found: Defined if SDK has the Google static library for Vulkan shader compilation (shaderc_combined). +``Vulkan::SPIRV-Tools`` + .. versionadded:: 3.24 + + Defined if SDK has the Khronos library to process SPIR-V modules + (SPIRV-Tools). + Result Variables ^^^^^^^^^^^^^^^^ @@ -69,9 +76,10 @@ This module defines the following variables: .. versionadded:: 3.24 True, if the SDK has the shaderc_combined library. +``Vulkan_SPIRV-Tools_FOUND`` + .. versionadded:: 3.24 -.. versionadded:: 3.24 - Variables for component library ``shaderc_combined``. + True, if the SDK has the SPIRV-Tools library. The module will also defines these cache variables: @@ -87,6 +95,10 @@ The module will also defines these cache variables: .. versionadded:: 3.24 Path to the shaderc_combined library. +``Vulkan_SPIRV-Tools_LIBRARY`` + .. versionadded:: 3.24 + + Path to the SPIRV-Tools library. Hints ^^^^^ @@ -177,6 +189,19 @@ if(shaderc_combined IN_LIST Vulkan_FIND_COMPONENTS) ${_Vulkan_hint_library_search_paths}) mark_as_advanced(Vulkan_shaderc_combined_DEBUG_LIBRARY) endif() +if(SPIRV-Tools IN_LIST Vulkan_FIND_COMPONENTS) + find_library(Vulkan_SPIRV-Tools_LIBRARY + NAMES SPIRV-Tools + HINTS + ${_Vulkan_hint_library_search_paths}) + mark_as_advanced(Vulkan_SPIRV-Tools_LIBRARY) + + find_library(Vulkan_SPIRV-Tools_DEBUG_LIBRARY + NAMES SPIRV-Toolsd + HINTS + ${_Vulkan_hint_library_search_paths}) + mark_as_advanced(Vulkan_SPIRV-Tools_DEBUG_LIBRARY) +endif() function(_Vulkan_set_library_component_found component) if(Vulkan_${component}_LIBRARY OR Vulkan_${component}_DEBUG_LIBRARY) @@ -202,6 +227,7 @@ function(_Vulkan_set_library_component_found component) endfunction() _Vulkan_set_library_component_found(shaderc_combined) +_Vulkan_set_library_component_found(SPIRV-Tools) set(Vulkan_LIBRARIES ${Vulkan_LIBRARY}) set(Vulkan_INCLUDE_DIRS ${Vulkan_INCLUDE_DIR}) @@ -288,6 +314,29 @@ if(Vulkan_FOUND) Threads::Threads) endif() endif() + + if((Vulkan_SPIRV-Tools_LIBRARY OR Vulkan_SPIRV-Tools_DEBUG_LIBRARY) AND NOT TARGET Vulkan::SPIRV-Tools) + add_library(Vulkan::SPIRV-Tools STATIC IMPORTED) + set_property(TARGET Vulkan::SPIRV-Tools + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_SPIRV-Tools_LIBRARY) + set_property(TARGET Vulkan::SPIRV-Tools APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::SPIRV-Tools + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_SPIRV-Tools_LIBRARY}") + endif() + if(Vulkan_SPIRV-Tools_DEBUG_LIBRARY) + set_property(TARGET Vulkan::SPIRV-Tools APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::SPIRV-Tools + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_SPIRV-Tools_DEBUG_LIBRARY}") + endif() + endif() endif() unset(_Vulkan_library_name) diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt index 005497c..be407c5 100644 --- a/Tests/FindVulkan/Test/CMakeLists.txt +++ b/Tests/FindVulkan/Test/CMakeLists.txt @@ -6,7 +6,8 @@ include(CTest) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../Modules) find_package(Vulkan REQUIRED COMPONENTS - shaderc_combined) + shaderc_combined + SPIRV-Tools) add_executable(test_tgt main.c) target_link_libraries(test_tgt Vulkan::Vulkan) @@ -37,6 +38,17 @@ if(NOT shaderc_combined_debug_location) MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") endif() +add_executable(test_tgt_SPIRV-Tools main-SPIRV-Tools.c) +target_link_libraries(test_tgt_SPIRV-Tools Vulkan::SPIRV-Tools) +add_test(NAME test_tgt_SPIRV-Tools COMMAND test_tgt_SPIRV-Tools) + +get_property(SPIRV-Tools_debug_location TARGET Vulkan::SPIRV-Tools PROPERTY IMPORTED_LOCATION_DEBUG) +if(NOT SPIRV-Tools_debug_location) + set_property(TARGET test_tgt_SPIRV-Tools + PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") +endif() + if(Vulkan_GLSLC_EXECUTABLE) add_test(NAME test_glslc COMMAND ${CMAKE_COMMAND} diff --git a/Tests/FindVulkan/Test/main-SPIRV-Tools.c b/Tests/FindVulkan/Test/main-SPIRV-Tools.c new file mode 100644 index 0000000..097198d --- /dev/null +++ b/Tests/FindVulkan/Test/main-SPIRV-Tools.c @@ -0,0 +1,15 @@ +#include +#include +#include + +int main() +{ + const char* spv_version = spvSoftwareVersionString(); + const char* spv_details = spvSoftwareVersionDetailsString(); + assert(spv_version); + assert(spv_details); + + printf("SPIRV-Tools version: %s (details: %s)", spv_version, spv_details); + + return 0; +} -- cgit v0.12 From 9f8720e74c01f209126a036d13aaccf15a1b4f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Wed, 18 May 2022 17:19:20 +0200 Subject: FindVulkan: Add component for `glslang` --- Modules/FindVulkan.cmake | 282 ++++++++++++++++++++++++++++++++- Tests/FindVulkan/Test/CMakeLists.txt | 12 ++ Tests/FindVulkan/Test/main-glslang.cxx | 24 +++ 3 files changed, 315 insertions(+), 3 deletions(-) create mode 100644 Tests/FindVulkan/Test/main-glslang.cxx diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 8446c6c..0c9f9b9 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -15,7 +15,7 @@ Optional COMPONENTS .. versionadded:: 3.24 -This module respects several optional COMPONENTS: ``shaderc_combined`` and +This module respects several optional COMPONENTS: ``glslang`` ``shaderc_combined`` and ``SPIRV-Tools``. There are corresponding import targets for each of these flags. @@ -45,6 +45,12 @@ This module defines :prop_tgt:`IMPORTED` targets if Vulkan has been found: The glslangValidator tool, if found. It is used to compile GLSL and HLSL shaders into SPIR-V. +``Vulkan::glslang`` + .. versionadded:: 3.24 + + Defined if SDK has the Khronos-reference front-end shader parser and SPIR-V + generator library (glslang). + ``Vulkan::shaderc_combined`` .. versionadded:: 3.24 @@ -72,6 +78,10 @@ This module defines the following variables: .. versionadded:: 3.23 value from ``vulkan/vulkan_core.h`` +``Vulkan_glslang_FOUND`` + .. versionadded:: 3.24 + + True, if the SDK has the glslang library. ``Vulkan_shaderc_combined_FOUND`` .. versionadded:: 3.24 @@ -91,6 +101,10 @@ The module will also defines these cache variables: the path to the GLSL SPIR-V compiler ``Vulkan_GLSLANG_VALIDATOR_EXECUTABLE`` the path to the glslangValidator tool +``Vulkan_glslang_LIBRARY`` + .. versionadded:: 3.24 + + Path to the glslang library. ``Vulkan_shaderc_combined_LIBRARY`` .. versionadded:: 3.24 @@ -176,6 +190,91 @@ find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE ) mark_as_advanced(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) +if(glslang IN_LIST Vulkan_FIND_COMPONENTS) + find_library(Vulkan_glslang-spirv_LIBRARY + NAMES SPIRV + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-spirv_LIBRARY) + + find_library(Vulkan_glslang-spirv_DEBUG_LIBRARY + NAMES SPIRVd + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-spirv_DEBUG_LIBRARY) + + find_library(Vulkan_glslang-oglcompiler_LIBRARY + NAMES OGLCompiler + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-oglcompiler_LIBRARY) + + find_library(Vulkan_glslang-oglcompiler_DEBUG_LIBRARY + NAMES OGLCompilerd + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-oglcompiler_DEBUG_LIBRARY) + + find_library(Vulkan_glslang-osdependent_LIBRARY + NAMES OSDependent + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-osdependent_LIBRARY) + + find_library(Vulkan_glslang-osdependent_DEBUG_LIBRARY + NAMES OSDependentd + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-osdependent_DEBUG_LIBRARY) + + find_library(Vulkan_glslang-machineindependent_LIBRARY + NAMES MachineIndependent + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-machineindependent_LIBRARY) + + find_library(Vulkan_glslang-machineindependent_DEBUG_LIBRARY + NAMES MachineIndependentd + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-machineindependent_DEBUG_LIBRARY) + + find_library(Vulkan_glslang-genericcodegen_LIBRARY + NAMES GenericCodeGen + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-genericcodegen_LIBRARY) + + find_library(Vulkan_glslang-genericcodegen_DEBUG_LIBRARY + NAMES GenericCodeGend + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang-genericcodegen_DEBUG_LIBRARY) + + find_library(Vulkan_glslang_LIBRARY + NAMES glslang + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang_LIBRARY) + + find_library(Vulkan_glslang_DEBUG_LIBRARY + NAMES glslangd + HINTS + ${_Vulkan_hint_library_search_paths} + ) + mark_as_advanced(Vulkan_glslang_DEBUG_LIBRARY) +endif() if(shaderc_combined IN_LIST Vulkan_FIND_COMPONENTS) find_library(Vulkan_shaderc_combined_LIBRARY NAMES shaderc_combined @@ -204,14 +303,27 @@ if(SPIRV-Tools IN_LIST Vulkan_FIND_COMPONENTS) endif() function(_Vulkan_set_library_component_found component) - if(Vulkan_${component}_LIBRARY OR Vulkan_${component}_DEBUG_LIBRARY) + cmake_parse_arguments(PARSE_ARGV 1 _ARG + "NO_WARNING" + "" + "DEPENDENT_COMPONENTS") + + set(all_dependent_component_found TRUE) + foreach(dependent_component IN LISTS _ARG_DEPENDENT_COMPONENTS) + if(NOT Vulkan_${dependent_component}_FOUND) + set(all_dependent_component_found FALSE) + break() + endif() + endforeach() + + if(all_dependent_component_found AND (Vulkan_${component}_LIBRARY OR Vulkan_${component}_DEBUG_LIBRARY)) set(Vulkan_${component}_FOUND TRUE PARENT_SCOPE) # For Windows Vulkan SDK, third party tools binaries are provided with different MSVC ABI: # - Release binaries uses a runtime library # - Debug binaries uses a debug runtime library # This lead to incompatibilities in linking for some configuration types due to CMake-default or project-configured selected MSVC ABI. - if(WIN32) + if(WIN32 AND NOT _ARG_NO_WARNING) if(NOT Vulkan_${component}_LIBRARY) message(WARNING "Library ${component} for Release configuration is missing, imported target Vulkan::${component} may not be able to link when targeting this build configuration due to incompatible MSVC ABI.") @@ -226,6 +338,18 @@ function(_Vulkan_set_library_component_found component) endif() endfunction() +_Vulkan_set_library_component_found(glslang-spirv NO_WARNING) +_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(shaderc_combined) _Vulkan_set_library_component_found(SPIRV-Tools) @@ -285,6 +409,158 @@ if(Vulkan_FOUND AND Vulkan_GLSLANG_VALIDATOR_EXECUTABLE AND NOT TARGET Vulkan::g endif() if(Vulkan_FOUND) + if((Vulkan_glslang-spirv_LIBRARY OR Vulkan_glslang-spirv_DEBUG_LIBRARY) AND NOT TARGET Vulkan::glslang-spirv) + add_library(Vulkan::glslang-spirv STATIC IMPORTED) + set_property(TARGET Vulkan::glslang-spirv + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_glslang-spirv_LIBRARY) + set_property(TARGET Vulkan::glslang-spirv APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::glslang-spirv + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_glslang-spirv_LIBRARY}") + endif() + if(Vulkan_glslang-spirv_DEBUG_LIBRARY) + set_property(TARGET Vulkan::glslang-spirv APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::glslang-spirv + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_glslang-spirv_DEBUG_LIBRARY}") + endif() + endif() + + if((Vulkan_glslang-oglcompiler_LIBRARY OR Vulkan_glslang-oglcompiler_DEBUG_LIBRARY) AND NOT TARGET Vulkan::glslang-oglcompiler) + add_library(Vulkan::glslang-oglcompiler STATIC IMPORTED) + set_property(TARGET Vulkan::glslang-oglcompiler + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_glslang-oglcompiler_LIBRARY) + set_property(TARGET Vulkan::glslang-oglcompiler APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::glslang-oglcompiler + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_glslang-oglcompiler_LIBRARY}") + endif() + if(Vulkan_glslang-oglcompiler_DEBUG_LIBRARY) + set_property(TARGET Vulkan::glslang-oglcompiler APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::glslang-oglcompiler + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_glslang-oglcompiler_DEBUG_LIBRARY}") + endif() + endif() + + if((Vulkan_glslang-osdependent_LIBRARY OR Vulkan_glslang-osdependent_DEBUG_LIBRARY) AND NOT TARGET Vulkan::glslang-osdependent) + add_library(Vulkan::glslang-osdependent STATIC IMPORTED) + set_property(TARGET Vulkan::glslang-osdependent + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_glslang-osdependent_LIBRARY) + set_property(TARGET Vulkan::glslang-osdependent APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::glslang-osdependent + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_glslang-osdependent_LIBRARY}") + endif() + if(Vulkan_glslang-osdependent_DEBUG_LIBRARY) + set_property(TARGET Vulkan::glslang-osdependent APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::glslang-osdependent + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_glslang-osdependent_DEBUG_LIBRARY}") + endif() + endif() + + if((Vulkan_glslang-machineindependent_LIBRARY OR Vulkan_glslang-machineindependent_DEBUG_LIBRARY) AND NOT TARGET Vulkan::glslang-machineindependent) + add_library(Vulkan::glslang-machineindependent STATIC IMPORTED) + set_property(TARGET Vulkan::glslang-machineindependent + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_glslang-machineindependent_LIBRARY) + set_property(TARGET Vulkan::glslang-machineindependent APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::glslang-machineindependent + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_glslang-machineindependent_LIBRARY}") + endif() + if(Vulkan_glslang-machineindependent_DEBUG_LIBRARY) + set_property(TARGET Vulkan::glslang-machineindependent APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::glslang-machineindependent + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_glslang-machineindependent_DEBUG_LIBRARY}") + endif() + endif() + + if((Vulkan_glslang-genericcodegen_LIBRARY OR Vulkan_glslang-genericcodegen_DEBUG_LIBRARY) AND NOT TARGET Vulkan::glslang-genericcodegen) + add_library(Vulkan::glslang-genericcodegen STATIC IMPORTED) + set_property(TARGET Vulkan::glslang-genericcodegen + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_glslang-genericcodegen_LIBRARY) + set_property(TARGET Vulkan::glslang-genericcodegen APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::glslang-genericcodegen + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_glslang-genericcodegen_LIBRARY}") + endif() + if(Vulkan_glslang-genericcodegen_DEBUG_LIBRARY) + set_property(TARGET Vulkan::glslang-genericcodegen APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::glslang-genericcodegen + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_glslang-genericcodegen_DEBUG_LIBRARY}") + endif() + endif() + + 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 + PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}") + if(Vulkan_glslang_LIBRARY) + set_property(TARGET Vulkan::glslang APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Release) + set_property(TARGET Vulkan::glslang + PROPERTY + IMPORTED_LOCATION_RELEASE "${Vulkan_glslang_LIBRARY}") + endif() + if(Vulkan_glslang_DEBUG_LIBRARY) + set_property(TARGET Vulkan::glslang APPEND + PROPERTY + IMPORTED_CONFIGURATIONS Debug) + set_property(TARGET Vulkan::glslang + PROPERTY + IMPORTED_LOCATION_DEBUG "${Vulkan_glslang_DEBUG_LIBRARY}") + endif() + target_link_libraries(Vulkan::glslang + INTERFACE + Vulkan::glslang-spirv + Vulkan::glslang-oglcompiler + Vulkan::glslang-osdependent + Vulkan::glslang-machineindependent + Vulkan::glslang-genericcodegen + ) + endif() + if((Vulkan_shaderc_combined_LIBRARY OR Vulkan_shaderc_combined_DEBUG_LIBRARY) AND NOT TARGET Vulkan::shaderc_combined) add_library(Vulkan::shaderc_combined STATIC IMPORTED) set_property(TARGET Vulkan::shaderc_combined diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt index be407c5..99cf427 100644 --- a/Tests/FindVulkan/Test/CMakeLists.txt +++ b/Tests/FindVulkan/Test/CMakeLists.txt @@ -6,6 +6,7 @@ include(CTest) SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../Modules) find_package(Vulkan REQUIRED COMPONENTS + glslang shaderc_combined SPIRV-Tools) @@ -27,6 +28,17 @@ target_include_directories(test_var_dl PRIVATE ${Vulkan_INCLUDE_DIRS}) target_link_libraries(test_var_dl ${CMAKE_DL_LIBS}) add_test(NAME test_var_dl COMMAND test_var_dl) +add_executable(test_tgt_glslang main-glslang.cxx) +target_link_libraries(test_tgt_glslang Vulkan::glslang) +add_test(NAME test_tgt_glslang COMMAND test_tgt_glslang) + +get_property(glslang_debug_location TARGET Vulkan::glslang PROPERTY IMPORTED_LOCATION_DEBUG) +if(NOT glslang_debug_location) + set_property(TARGET test_tgt_glslang + PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") +endif() + add_executable(test_tgt_shaderc_combined main-shaderc_combined.cxx) target_link_libraries(test_tgt_shaderc_combined Vulkan::shaderc_combined) add_test(NAME test_tgt_shaderc_combined COMMAND test_tgt_shaderc_combined) diff --git a/Tests/FindVulkan/Test/main-glslang.cxx b/Tests/FindVulkan/Test/main-glslang.cxx new file mode 100644 index 0000000..81b18d6 --- /dev/null +++ b/Tests/FindVulkan/Test/main-glslang.cxx @@ -0,0 +1,24 @@ +#include +#include + +#include + +int main() +{ + const glslang::Version glslang_version = glslang::GetVersion(); + const char* glslang_essl_version = glslang::GetEsslVersionString(); + const char* glslang_glsl_version = glslang::GetGlslVersionString(); + const int glslang_khronos_tool_id = glslang::GetKhronosToolId(); + + std::cout << "glslang Version: " << glslang_version.major << '.' + << glslang_version.minor << '.' << glslang_version.patch + << " (glsl version: " << glslang_glsl_version + << ", essl version:" << glslang_essl_version + << ", khronos tool:" << glslang_khronos_tool_id << ')' + << std::endl; + + assert(glslang_essl_version); + assert(glslang_glsl_version); + + return 0; +} -- cgit v0.12 From 998ee49779147372f58b66464860bc0cd159a7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Wed, 18 May 2022 17:20:42 +0200 Subject: FindVulkan: ensure policy CMP0057 is NEW to use `IN_LIST` with `if()` --- Modules/FindVulkan.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 0c9f9b9..d72dc30 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -127,6 +127,9 @@ environment. #]=======================================================================] +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) + if(WIN32) set(_Vulkan_library_name vulkan-1) set(_Vulkan_hint_include_search_paths @@ -619,3 +622,5 @@ unset(_Vulkan_library_name) unset(_Vulkan_hint_include_search_paths) unset(_Vulkan_hint_executable_search_paths) unset(_Vulkan_hint_library_search_paths) + +cmake_policy(POP) -- cgit v0.12 From acdb5fe0e842cfd667c00d8f24d37479aa05304f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Sat, 14 May 2022 00:34:27 +0200 Subject: FindVulkan: Add component for `glslc` and `glslangValidator` For backward compatibility with previous CMake versions they are implicitly added to the list of components --- Modules/FindVulkan.cmake | 65 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index d72dc30..7a32c2f 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -15,9 +15,9 @@ Optional COMPONENTS .. versionadded:: 3.24 -This module respects several optional COMPONENTS: ``glslang`` ``shaderc_combined`` and -``SPIRV-Tools``. There are corresponding import targets for each of these -flags. +This module respects several optional COMPONENTS: ``glslc``, +``glslangValidator``, ``glslang``, ``shaderc_combined`` and ``SPIRV-Tools``. +There are corresponding import targets for each of these flags. IMPORTED Targets ^^^^^^^^^^^^^^^^ @@ -78,6 +78,14 @@ This module defines the following variables: .. versionadded:: 3.23 value from ``vulkan/vulkan_core.h`` +``Vulkan_glslc_FOUND`` + .. versionadded:: 3.24 + + True, if the SDK has the glslc executable. +``Vulkan_glslangValidator_FOUND`` + .. versionadded:: 3.24 + + True, if the SDK has the glslangValidator executable. ``Vulkan_glslang_FOUND`` .. versionadded:: 3.24 @@ -130,6 +138,15 @@ environment. cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) +# 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) + list(APPEND Vulkan_FIND_COMPONENTS glslc) +endif() +if(NOT glslangValidator IN_LIST Vulkan_FIND_COMPONENTS) + list(APPEND Vulkan_FIND_COMPONENTS glslangValidator) +endif() + if(WIN32) set(_Vulkan_library_name vulkan-1) set(_Vulkan_hint_include_search_paths @@ -179,20 +196,22 @@ find_library(Vulkan_LIBRARY ) mark_as_advanced(Vulkan_LIBRARY) -find_program(Vulkan_GLSLC_EXECUTABLE - NAMES glslc - HINTS - ${_Vulkan_hint_executable_search_paths} - ) -mark_as_advanced(Vulkan_GLSLC_EXECUTABLE) - -find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE - NAMES glslangValidator - HINTS - ${_Vulkan_hint_executable_search_paths} - ) -mark_as_advanced(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) - +if(glslc IN_LIST Vulkan_FIND_COMPONENTS) + find_program(Vulkan_GLSLC_EXECUTABLE + NAMES glslc + HINTS + ${_Vulkan_hint_executable_search_paths} + ) + mark_as_advanced(Vulkan_GLSLC_EXECUTABLE) +endif() +if(glslangValidator IN_LIST Vulkan_FIND_COMPONENTS) + find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE + NAMES glslangValidator + HINTS + ${_Vulkan_hint_executable_search_paths} + ) + mark_as_advanced(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) +endif() if(glslang IN_LIST Vulkan_FIND_COMPONENTS) find_library(Vulkan_glslang-spirv_LIBRARY NAMES SPIRV @@ -305,6 +324,18 @@ if(SPIRV-Tools IN_LIST Vulkan_FIND_COMPONENTS) mark_as_advanced(Vulkan_SPIRV-Tools_DEBUG_LIBRARY) endif() +if(Vulkan_GLSLC_EXECUTABLE) + set(Vulkan_glslc_FOUND TRUE) +else() + set(Vulkan_glslc_FOUND FALSE) +endif() + +if(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) + set(Vulkan_glslangValidator_FOUND TRUE) +else() + set(Vulkan_glslangValidator_FOUND FALSE) +endif() + function(_Vulkan_set_library_component_found component) cmake_parse_arguments(PARSE_ARGV 1 _ARG "NO_WARNING" -- cgit v0.12 From 7974fcd1a77e6a1e8c625ac62824e07f37e0ab3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MACHIZAUD=20Andr=C3=A9a?= Date: Thu, 12 May 2022 15:18:45 +0200 Subject: FindVulkan: remove noop on CMAKE_MODULE_PATH in tests --- Tests/FindVulkan/Test/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt index 99cf427..a492daa 100644 --- a/Tests/FindVulkan/Test/CMakeLists.txt +++ b/Tests/FindVulkan/Test/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_policy(SET CMP0091 NEW) project(TestFindVulkan C CXX) include(CTest) -SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../Modules) find_package(Vulkan REQUIRED COMPONENTS glslang -- cgit v0.12