Update iOS build and CI to support standardization of FindVulkan.cmake#1500
Update iOS build and CI to support standardization of FindVulkan.cmake#1500SRSaunders wants to merge 12 commits intoKhronosGroup:mainfrom
Conversation
…s - use pre-builts instead
…le for debug builds
be4191b to
c67172f
Compare
|
For reference: my MR on upstream CMake to import layer variables back into https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11808 We should be on feature parity once this lands. |
fgiancane8
left a comment
There was a problem hiding this comment.
Tested on latest CMake. Vulkan frameworks and related libraries are found and processed as expected.
|
I added one additional commit to:
Ready for review. |
Changes are addressed in KhronosGroup#1500.
FYI @SRSaunders this landed and it's targeting CMake 4.4.0 release. All the available layers in SDK are enumerated and given their own variables. This should close the loop on upstream CMake requirements to be able to build successfully for iOS as well. Let me know if something else is missing. |
Thanks @fgiancane8 for the upstream status. Note this PR now contains a fail-safe (see item 4 above in the PR description) for the Therefore this PR effectively decouples the project's iOS build from the timing around CMake 4.4.0, as well as possible deletion of the the project's downstream FindVulkan.cmake. If/when this PR is merged, these items should become independent decisions going forward. |
Sounds good to me. Just FYI please note that upstream has adopted a slightly different naming scheme for these variables: We may want to align them before removing the downstream version. |
Thanks for the heads up. Even if the No need to update this PR at this time. Thanks @fgiancane8 for your initiative with this effort. |
Sure, no worries at all. We can follow up once we're ready to move away completely from the vendored version here. |
| @@ -0,0 +1,44 @@ | |||
| #[[ | |||
|
|
|||
| Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | |||
There was a problem hiding this comment.
| Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | |
| Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. Not a contribution. |
@SRSaunders can you please accept this change? Legal team reviewed this and requested the copyright to be stated like this, according to Apache-2.0 license.
Otherwise, LGTM.
There was a problem hiding this comment.
Ok, but if it's not a contribution, then what is it? I am not sure I understand the intent of this change from your legal folks. Can you clarify what this means?
There was a problem hiding this comment.
From Apache 2 license:
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
Last line in the license explains the "Not a Contribution" usage in copyrights. I relayed your question to the Legal team to provide more clarity here.
There was a problem hiding this comment.
Well, I am not a maintainer on this project so I cannot say whether this can be accepted or not. You will have to ask @gpx1000 about that.
However, based on the above text, "Contribution" and "submitted" are exactly what we are doing here, which is described by "communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work".
The next clause "but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." means that we should NOT include in the license any further improvements discussed by you if you mark a new communication as such. Note the exact wording here: the license talks about marking "communication as Not a Contribution", not the licensed work itself. That means in future discussion that you could mark a new idea as Not a Contribution and it would not be incorporated in the code and not included in the original license. That would be more reasonable.
However, these kinds of communication clauses are typically put in licensing agreements when the IP licensing is 1-way only, with no follow-on discussion desired by the licensee. That approach is not very typical of open source where ongoing contribution and discussion is typically welcomed and encouraged.
There was a problem hiding this comment.
@SRSaunders thanks for all the clarifications. As you can imagine, I am not a legal person myself so I am following what folks from legal team told me to do. Please bear with me some more time to see if I can get some more information and/or inputs on how we can better address this.
@gpx1000 since you're maintainer here, any history/inputs/etc would be very much appreciated.
Thanks all folks, hopefully we'll get it sorted out quickly.
There was a problem hiding this comment.
Thanks for looking into this. At the simplest level, you can't make a contribution and then call it "Not a contribution". However, new stuff can be discussed but not contributed as long as you mark it that way.
There was a problem hiding this comment.
@marty-johnson59 Could you take a look? I think we're fine but I'm not a lawyer, and have no wish to have an opinion.
There was a problem hiding this comment.
I'll bring this up with Khronos legal, but my read is that this was a "contribution", so not sure we're OK with marking it as "not a contribution"... @fgiancane8, can you help clarify how/why this should not be considered a contribution? That might help our legal team sort this out. Thanks
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:
Vulkan_Target_SDKcmake 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.Vulkan_Layer_VALIDATIONcmake 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
threefour other related items here:VK_LAYER_KHRONOS_validationto 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.VK_LAYER_KHRONOS_validationset to Required.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:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batchcommand line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: