Skip to content

Commit f23a66e

Browse files
committed
Search for Vulkan_Layer_VALIDATION on iOS if not defined or found by FindVulkan.cmake
1 parent c67172f commit f23a66e

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ if(IOS)
137137
endif ()
138138
# Vulkan cache variables already defined by main project CMakeLists and updated on Apple platforms by global_options.cmake
139139
if(Vulkan_LIBRARY AND ${Vulkan_VERSION} VERSION_GREATER_EQUAL 1.3.278)
140-
get_filename_component(Vulkan_Target_SDK "$ENV{VULKAN_SDK}" REALPATH)
140+
get_filename_component(Vulkan_Target_SDK "$ENV{VULKAN_SDK}/.." REALPATH)
141141
target_sources(${PROJECT_NAME} PRIVATE
142-
${Vulkan_Target_SDK}/share/vulkan
142+
${Vulkan_Target_SDK}/iOS/share/vulkan
143143
)
144144
set_source_files_properties(
145-
${Vulkan_Target_SDK}/share/vulkan
145+
${Vulkan_Target_SDK}/iOS/share/vulkan
146146
PROPERTIES
147147
MACOSX_PACKAGE_LOCATION Resources
148148
)

bldsys/cmake/global_options.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[[
2-
Copyright (c) 2019-2025, Arm Limited and Contributors
2+
Copyright (c) 2019-2026, Arm Limited and Contributors
33
44
SPDX-License-Identifier: Apache-2.0
55
@@ -78,10 +78,10 @@ if(APPLE)
7878
else()
7979
message(FATAL_ERROR "Can't find MoltenVK library. Please install the Vulkan SDK or MoltenVK project and set VULKAN_SDK.")
8080
endif()
81-
#elseif(OTHER_VULKAN_DRIVER)
82-
# handle any special processing here for other Vulkan driver (e.g. KosmicKrisp) for standalone usage on macOS or deployment to iOS
83-
# would likely require extensions to CMake find_package() OPTIONAL_COMPONENTS and library variables to identify & use other driver
84-
#else()
81+
elseif(IOS AND NOT Vulkan_Layer_VALIDATION)
82+
# if building for iOS devices (not iOS Simulator as above) and Vulkan_Layer_VALIDATION is not defined or found, search in the Vulkan SDK
83+
find_library(Vulkan_Layer_VALIDATION NAMES VkLayer_khronos_validation HINTS "$ENV{VULKAN_SDK}/lib")
84+
else()
8585
# if not using standalone driver, retain find_package() results for Vulkan driver, Vulkan loader, and Validation Layer library variables
8686
# no need to override with _HPP_VULKAN_LIBRARY in this case since Vulkan DynamicLoader will find/load Vulkan library on macOS & iOS
8787
endif()

0 commit comments

Comments
 (0)