Skip to content

Vulkan module no longer experimental; update CI and toolchains - #2687

Open
sharadhr wants to merge 10 commits into
KhronosGroup:mainfrom
sharadhr:ci/cmake-update-macos
Open

sharadhr wants to merge 10 commits into
KhronosGroup:mainfrom
sharadhr:ci/cmake-update-macos

Conversation

@sharadhr

@sharadhr sharadhr commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

With CMake 4.5.0, we finally remove the experimental status of import std; and of module vulkan; as a whole. Here the documentation, the CI, and the CMake lists code have all been rewritten to support the new functionality.

Additionally, the toolchains and CI have all been updated to follow CMake best practices for setting the standard module library path, instead of doing questionable stuff with sed on CMake's vendored source files.

Resolves #2689 and #2747 as well.

@sharadhr

sharadhr commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

CI currently fails on this branch because CMake poorly handles the MSVC standard library module. I will un-draft and update when CMake 4.5 has been publicly released.

@sharadhr
sharadhr force-pushed the ci/cmake-update-macos branch from 69314e5 to 1846819 Compare September 27, 2026 13:33
@sharadhr

sharadhr commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

@asuessenbach, with this PR, vulkan.cppm will no longer be experimental. This change depends on a change for CMake 4.5 that will bring import std; out of experimental status, and once that is done, I will also change the CI:

https://github.com/sharadhr/Vulkan-Hpp/blob/49a13895c231a6ae4640c1462c6e641988823f0f/.github/workflows/build.yml#L87-L114

to use CMake 4.5 stable, mark this ready for review. After this, we can then un-draft, review, and consider merging #2667.

@asuessenbach

Copy link
Copy Markdown
Contributor

... that is: this PR is ready for review?

@sharadhr

sharadhr commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Not yet! As mentioned this still uses the nightly CMake version. CMake 4.5 should land in the next couple of weeks and I will update this PR correspondingly.

The bulk of the PR will remain unchanged however, so if you want to look at it anyway, there won't be any change to the rest of the code.

@sharadhr
sharadhr force-pushed the ci/cmake-update-macos branch 3 times, most recently from d696a1d to 1491189 Compare October 19, 2026 08:10
@sharadhr
sharadhr force-pushed the ci/cmake-update-macos branch from 1491189 to ddd4463 Compare October 27, 2026 22:23
- simplify modules flags for macOS; pass in JSON flag in CI and test
Make VULKAN_HPP_BUILD_CXX_MODULE depend solely on
CMAKE_CXX_STDLIB_MODULES_JSON, which CMake sets after project() when the
generator, compiler, and standard library support `import std`. Projects
with an unsupported toolchain (e.g. GCC < 15, Apple Clang, Visual Studio
generators) are therefore unaffected. Earlier CMake versions only set it
when their experimental `import std` support is enabled.

When available, the module is enabled by default, and may be disabled
with -D VULKAN_HPP_BUILD_CXX_MODULE=OFF.

CI now uses a CMake 4.5 nightly, so the tests no longer pass
VULKAN_HPP_BUILD_CXX_MODULE explicitly.
CMake 4.5 reports import std support for toolchains that cannot build the
module, such as clang-cl 19 with the MSVC STL, so the module was enabled
by default on runners that only test the headers. Set
VULKAN_HPP_BUILD_CXX_MODULE explicitly for every configure step.
Setting VULKAN_HPP_BUILD_CXX_MODULE for every configure step broke the
macOS module runner: only the tests step selects Homebrew LLVM there, so
the generator step tried to build the module with AppleClang, which
cannot scan for module dependencies.

The generator and plain samples steps do not need the module, so disable
it there explicitly rather than relying on detection, which also enables
it for toolchains that cannot build it (e.g. clang-cl 19 with the MSVC
STL). The tests step enables it only on module runners again.
CMake 4.5.0 has been released, so install it with lukka/get-cmake
(`latest`) rather than downloading a pinned nightly.
@sharadhr
sharadhr force-pushed the ci/cmake-update-macos branch from ddd4463 to 2fcd443 Compare November 13, 2026 20:59
@sharadhr sharadhr changed the title CI: Update to latest CMake and Clang, and simplify CI for macOS CI: Update to latest CMake and Clang Nov 13, 2026
@sharadhr sharadhr changed the title CI: Update to latest CMake and Clang CI: Toolchain and module updates Nov 13, 2026
@sharadhr
sharadhr marked this pull request as ready for review November 13, 2026 21:18
@sharadhr

Copy link
Copy Markdown
Contributor Author

Ready for review, now that CMake 4.5.0 is released.

@sharadhr sharadhr changed the title CI: Toolchain and module updates Vulkan module no longer experimental; update CI and toolchains Nov 13, 2026
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.

Modules: Don't include headers in module declaration

2 participants