Skip to content

Update iOS build and CI to support standardization of FindVulkan.cmake#1500

Open
SRSaunders wants to merge 8 commits intoKhronosGroup:mainfrom
SRSaunders:ios-build-tolerance
Open

Update iOS build and CI to support standardization of FindVulkan.cmake#1500
SRSaunders wants to merge 8 commits intoKhronosGroup:mainfrom
SRSaunders:ios-build-tolerance

Conversation

@SRSaunders
Copy link
Contributor

@SRSaunders SRSaunders commented Mar 7, 2026

Description

This PR updates the iOS build and CI to support future standardization of FindVulkan.cmake where there may be fewer project customizations present for iOS build targets. With these changes the project will build and run for iOS and iOS Simulator with no project-specific FindVulkan.cmake present in the tree, instead relying on the cmake's standard version of the module.

However, one downside in this scenario is the Vulkan Validation Layer would not be found for iOS and samples that rely on it would not run (e.g. shader_debugprintf). In addition, iOS debug builds would run but would not benefit from validation messages (now fixed by item 4 below). A separate effort is pushing project additions to the upstream FindVulkan.cmake to allow eventual migration to the standard cmake version. In the mean time the project FindVulkan.cmake will remain in place and this PR will not result in iOS regressions in any scenario.

The specific items that have changed are:

  1. A new ios.cmake toochain file has been introduced that sets common iOS cmake build variables and assists cmake's FindVulkan module in locating the Vulkan iOS frameworks. Thanks to @fgiancane8 for this idea and initial code. Co-Authored-By: Giancane, Francesco fgiancan@qti.qualcomm.com
  2. Updated CI command and End-user build docs for iOS and iOS Simulator using the new ios.cmake toolchain file.
  3. The Vulkan_Target_SDK cmake variable is now defined locally within Vulkan-Samples/app/CmakeLists.txt vs. depending on its definition within the project's FindVulkan.cmake. This approach makes more sense since this was a project-specific customization of FindVulkan.cmake and is the only location in the project build system (outside of FindVulkan.cmake itself) where this variable is used. Note the purpose of this variable is to locate the directory where Vulkan icd and layer json files can be found - required for packaging an iOS app bundle.
  4. The Vulkan_Layer_VALIDATION cmake variable is now defined within the iOS-specific section in Vulkan-Samples/bldsys/cmake/global_options.cmake if it's not already defined or found by FindVulkan.cmake. This acts as a fail-safe fallback that avoids any regressions in finding the validation layer for iOS within the project.

I have also taken the opportunity to address three other related items here:

  1. Prevent Apple (macOS, iOS, iOS Simulator) builds from compiling the shaders for every new build instance. Because Apple platforms always require the VULKAN_SDK, the current project build logic will define the shader compilers and force a build of the shaders. This is not optimal since the project already provides pre-compiled shaders and the extra build steps on Apple platforms adds complexity and time to the project build for end-users. This could also affect CI but I believe other steps have already been taken by @SaschaWillems to prevent that (at least for slang, not sure about other shader langs). Note on Windows platforms the end-user has control over this by choosing to run with the SDK installed or not. On Apple platforms the end-user has no choice since the SDK must be installed to provide the Vulkan libraries needed at runtime.
  2. Change VK_LAYER_KHRONOS_validation to be Optional for debug builds vs. Required. This applies to all platforms but allows debug builds to run even when the validation layer is not available. This is important for several use cases: a) Windows users who do not install the SDK, and b) on the iOS Simulator where the VVL library is not built for that target. I debated this change before making it, but I believe it is correct given that Windows build docs do not mention or require installation of the SDK, and the default build config for Visual Studio is debug. I am interested in feedback from maintainers on this regarding project intentions: i.e. Required forces a runtime error that prevents samples from running in debug mode, or Optional allows execution with a runtime warning message instead. I chose the latter.
  3. Updated Vulkan SDK to 1.4.341.1 for iOS CI builds. This matches the project and I thought this would be a good time to update given the other iOS CI changes.

Fixes iOS build issues associated with pull request #1490. See additional discussion there.

Tested on Windows 11 and macOS Sequoia with macOS x86_64, iOS arm64, and iOS Simulator x86_64 targets.

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • I did a full batch run using the batch command line argument to make sure all samples still work properly

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • If the sample is vendor-specific, I have tagged it appropriately
  • I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • Any dependent assets have been merged and published in downstream modules
  • For new samples, I have added a paragraph with a summary to the appropriate chapter in the readme of the folder that the sample belongs to e.g. api samples readme
  • For new samples, I have added a tutorial README.md file to guide users through what they need to know to implement code using this feature. For example, see conditional_rendering
  • For new samples, I have added a link to the Antora navigation so that the sample will be listed at the Vulkan documentation site

@SRSaunders SRSaunders force-pushed the ios-build-tolerance branch from be4191b to c67172f Compare March 7, 2026 22:28
@SRSaunders SRSaunders changed the title Update iOS build and CI to support future standarization of FindVulkan.cmake Update iOS build and CI to support standardization of FindVulkan.cmake Mar 9, 2026
@@ -0,0 +1,39 @@
#[[

Copyright (c) 2026, Francesco Giancane

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am generally OK with this attribution. I just need to double-check with my Company if there are extra lines to be added as well per our OSS policy.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if you do not mind, a Co-Authored-By: Giancane, Francesco <fgiancan@qti.qualcomm.com> tag in the commit message would be appreciated :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just need to double-check with my Company if there are extra lines to be added as well per our OSS policy

That may indeed require changing the copyright to Qualcomm. Please let me know.

Also, going back to the commit message may be tricky. I would have to rebase and reword then force push again. Would it be okay to add this attribution to item 1 above in the PR description? I will do that anyways.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah don't worry too much about that. There's no need to mess it up just for the tag, as it is not even mandatory. I am finishing double checking for the copyright. Keep you posted !

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
SPDX-License-Identifier: BSD-3-Clause-Clear

This is the copyright part for us. If you are posting a new commit on top of the existing ones the Co-Authored-By could be added there as well. Thanks!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BSD-3-Clause-Clear should be compatible with Apache-2.0 for what matters.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a new/changed license we might want to internally clarify this first.

Copy link
Contributor Author

@SRSaunders SRSaunders Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, here is example of what existing Qualcomm Licenses look like in the project:

/* Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 the "License";
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * ------------------------------------------------------------------------
 *
 * THIS IS A MODIFIED VERSION OF THE ORIGINAL FILE
 *
 * The original file, along with the original Apache-2.0 LICENSE can be found at:
 * https://github.com/google-research/jax3d/tree/main/jax3d/projects/mobilenerf
 *
 * Modification details: Shader code was updated to work on Vulkan (originally
 * built for WebGL)
 * Contributor: (Qualcomm) Rodrigo Holztrattner - quic_rholztra@quicinc.com
 */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a new/changed license we might want to internally clarify this first.

Yes this is my updated version of copyright marks. Let me double check again if it's fine to license under Apache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants