-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: Workaround MSVC module support compiler bug
Adds the VULKAN_HEADERS_ENABLE_MODULE option to control whether to build the Vulkan-Hpp module. This is necessary to allow CI to pass while waiting for the MSVC version 17.11, which fixes an internal compiler bug, to be added to github actions runners.
- Loading branch information
1 parent
cde27c9
commit e3c37e6
Showing
3 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e3c37e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this is also needed if you're building with clang-16 as otherwise you get:
e3c37e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the module code explicitly disable itself for clang-16? I don't want to cause widespread disruption due to the inclusion of the module code.
e3c37e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth it, although it was easy enough to fix https://dawn-review.googlesource.com/c/dawn/+/194861, I also don't know what version of clang you'd need to target in order for it to work, I just happen to have clang-16 on this machine.
e3c37e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dj2 So I did a little digging and it turns out clang-16 works just fine as long as the clang-scan-deps tool is installed. On ubuntu its located in clang-tools-16 package (or whatever your compiler version is). Different distro's call it different things.
Tested it locally and having the package installed makes it compile just fine. Not sure if Vulkan-Headers should check for the clang tool but it would have been nice if the tools required to build modules were included in the clang-16 package (which cmake claims can handle module scanning!)
CMake discourse with the relevant info:
https://discourse.cmake.org/t/cmake-3-28-cmake-cxx-compiler-clang-scan-deps-notfound-not-found/9244
e3c37e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good find on the clang-16 packages, that's probably exactly what's wrong with my machine.
Could you check that the
CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS
is notCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND
?e3c37e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the CMakeCache.txt, I see: