diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a78261d1d..5d44dd5198 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -187,9 +187,9 @@ jobs: - name: retrieve VulkanSDK if: steps.VulkanSDK.outputs.cache-hit != 'true' run: | - wget https://sdk.lunarg.com/sdk/download/1.4.304.1/mac/vulkansdk-macos-1.4.304.1.zip - unzip vulkansdk-macos-1.4.304.1.zip - sudo InstallVulkan-1.4.304.1.app/Contents/MacOS/InstallVulkan-1.4.304.1 --root ~/VulkanSDK --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.ios + wget https://sdk.lunarg.com/sdk/download/1.4.341.1/mac/vulkansdk-macos-1.4.341.1.zip + unzip vulkansdk-macos-1.4.341.1.zip + sudo vulkansdk-macOS-1.4.341.1.app/Contents/MacOS/vulkansdk-macOS-1.4.341.1 --root ~/VulkanSDK --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.ios - name: build_ios run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index f40039a3ac..de2026ae91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ -# Copyright (c) 2020-2025, Arm Limited and Contributors -# Copyright (c) 2024-2025, Mobica Limited -# Copyright (c) 2024-2025, Sascha Willems +# Copyright (c) 2020-2026, Arm Limited and Contributors +# Copyright (c) 2024-2026, Mobica Limited +# Copyright (c) 2024-2026, Sascha Willems # # SPDX-License-Identifier: Apache-2.0 # @@ -40,6 +40,11 @@ project(vulkan_samples) if(VKB_GENERATE_ANTORA_SITE) add_subdirectory(antora) else () +# On IOS we define CMAKE_FIND_ROOT_PATH to allow find_package(Vulkan) to locate the Vulkan frameworks for iOS +if(IOS) + set(CMAKE_FIND_ROOT_PATH "$ENV{VULKAN_SDK}") +endif() + # search for Vulkan SDK find_package(Vulkan) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 22c817f0ce..79eda8ce79 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2025, Arm Limited and Contributors +# Copyright (c) 2019-2026, Arm Limited and Contributors # # SPDX-License-Identifier: Apache-2.0 # @@ -137,6 +137,7 @@ if(IOS) endif () # Vulkan cache variables already defined by main project CMakeLists and updated on Apple platforms by global_options.cmake if(Vulkan_LIBRARY AND ${Vulkan_VERSION} VERSION_GREATER_EQUAL 1.3.278) + get_filename_component(Vulkan_Target_SDK "$ENV{VULKAN_SDK}/.." REALPATH) target_sources(${PROJECT_NAME} PRIVATE ${Vulkan_Target_SDK}/iOS/share/vulkan ) diff --git a/bldsys/cmake/global_options.cmake b/bldsys/cmake/global_options.cmake index 3c911aa2e6..4106aa6bba 100644 --- a/bldsys/cmake/global_options.cmake +++ b/bldsys/cmake/global_options.cmake @@ -1,5 +1,5 @@ #[[ - Copyright (c) 2019-2025, Arm Limited and Contributors + Copyright (c) 2019-2026, Arm Limited and Contributors SPDX-License-Identifier: Apache-2.0 @@ -78,10 +78,10 @@ if(APPLE) else() message(FATAL_ERROR "Can't find MoltenVK library. Please install the Vulkan SDK or MoltenVK project and set VULKAN_SDK.") endif() - #elseif(OTHER_VULKAN_DRIVER) - # handle any special processing here for other Vulkan driver (e.g. KosmicKrisp) for standalone usage on macOS or deployment to iOS - # would likely require extensions to CMake find_package() OPTIONAL_COMPONENTS and library variables to identify & use other driver - #else() + elseif(IOS AND NOT Vulkan_Layer_VALIDATION) + # if building for iOS devices (not iOS Simulator as above) and Vulkan_Layer_VALIDATION is not defined or found, search in the Vulkan SDK + find_library(Vulkan_Layer_VALIDATION NAMES VkLayer_khronos_validation HINTS "$ENV{VULKAN_SDK}/lib") + else() # if not using standalone driver, retain find_package() results for Vulkan driver, Vulkan loader, and Validation Layer library variables # no need to override with _HPP_VULKAN_LIBRARY in this case since Vulkan DynamicLoader will find/load Vulkan library on macOS & iOS endif()