Skip to content

Revised: Update iOS build to support future standarization of FindVulkan.cmake#1516

Open
SRSaunders wants to merge 2 commits intoKhronosGroup:mainfrom
SRSaunders:ios-build-resilience
Open

Revised: Update iOS build to support future standarization of FindVulkan.cmake#1516
SRSaunders wants to merge 2 commits intoKhronosGroup:mainfrom
SRSaunders:ios-build-resilience

Conversation

@SRSaunders
Copy link
Copy Markdown
Contributor

Description

Simplifies and replaces closed PR #1500.

This PR updates the iOS build and CI to support future standardization of FindVulkan.cmake where there may be fewer or no project customizations present for iOS build targets. With these changes the project will build and run for iOS and iOS Simulator with OR without the project-specific FindVulkan.cmake present in the tree, i.e. it only depends on the capabilities of cmake's standard version of the module without project-specific iOS customizations. This will permit eventual migration away from the project-specific FindVulkan.cmake. However, in the mean time the project FindVulkan.cmake will remain in place and this PR will not result in any iOS regressions, nor require any doc updates.

The specific items that have changed are:

  1. The CMAKE_FIND_ROOT_PATH variable is defined for iOS builds in the main CMakeLists file. This is to allow the standard non-customized FindVulkan.cmake to locate the iOS frameworks from the SDK. This is the key change that makes this PR work properly. While this adds one small item to the main CMakeLists file, it avoids a more complex approach using an iOS toolchain file (see closed PR Update iOS build and CI to support standardization of FindVulkan.cmake #1500) which is overkill for the solution.
  2. 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.
  3. The Vulkan_Layer_VALIDATION cmake variable is now located and 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.
  4. Updates the 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 build changes.

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

Tested on macOS Sequoia with 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

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.

1 participant