-
Notifications
You must be signed in to change notification settings - Fork 41
Fixed C++Module with better dependency management in CMake and newer VMA submodule commit hash #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The |
|
Hi @M2-TE, thank you. I have some concerns about your approach, but I need some time to re-read it and come up with a sensible feedback. In the meantime, could you please explain the exact issues you faced and fixed with this PR? I see what the changes are, but I don't understand what problems are those meant to solve. Answering your question, "generate headers" fails because VMA submodule is not meant to be updated manually - |
|
Yup the submodule was updated to fix the related issue, hadn't known how it was handled in this repo, sorry! As for the CMake changes, it is all related to module usage:
Theres probably two things I should do after looking at this PR again:
|
|
I think you're missing the (new) intended usage idea. A lot has changed with the latest big updates and the README was rewritten to make it more clear, hopefully. The most important part is that root CMakeLists is now for the generator and samples. You don't need it when using VMA-Hpp as a dependency in your project - you only need the one in the Also, it's recommended to use GH releases instead of checking out the whole repo. Release tarball contains only I agree that the ALIAS is ugly, but it also doesn't look fair to me to take the "VulkanMemoryAllocator" namespace because we're not the "original" VMA. Especially given that even VMA itself doesn't use that namespace, I feel this name may be misleading. |
|
Oh I see what you intended in that case. Though, checking out dependencies like this repo with FetchContent is a very common use case and it would be nice if the root CMake was capable of supporting this (providing the target and nothing more). As for the alias, it would make sense to be in the same namespace, no? |
|
We can check I partially agree, if VMA used "VulkanMemoryAllocator::" namespace, we could also use it for Hpp bindings (asking author's consent first). But VMA uses "GPUOpen::" namespace and we are not related to that in any way. And imo using "VulkanMemoryAllocator::" could be misleading because there would only be C++ and no C headers. I can see two solutions here:
|
|
You make a good point about the alias namespace though.. using GPUOpen doesn't fit (even if allowed) and I forgot VMA does not use |
|
But using FetchContent with the release tarball is as convenient as with the git repo, 3 similar LOC and no manual copies, see the example in https://github.com/YaaZ/VulkanMemoryAllocator-Hpp?tab=readme-ov-file#get-the-library Regarding alias - I would be happy to merge it if we manage to sort it out with VMA. |
|
I will check out FetchContent with release tarballs, maybe I've been missing out. I figured using tarballs wouldn't supply me with the CMake targets. As for the alias, of course, deprecation is much better than immediate removal. I'll close this PR in the meantime. The alias changes should be a separate PR if anything. Thanks for your inputs! |
The module was still broken when using the workflow provided in the current
CMakeLists.txt, so I went ahead and fixed it alongside a few other things. Will resolve #65. Changes include:::VulkanMemoryAllocator-Hppto::HppModule(same as Vulkan naming scheme). Better to do it now, while there are already breaking changes for the 3.3.0 release.->
vulkaninFetchContentwas renamed tovulkan-headersto match the "fetch content module name should match git URL" guidelineINTERFACE, while also performing the link outside the module logic (normal vma-hpp target also needs it)add_subdirectorynow properly checks whether the VMA submodule has even been checked out. If not, falls back toFetchContent. VMA dep logic for module has been simplified