[...]/vk_mem_alloc.h:2791: void* vma_aligned_alloc(size_t, size_t): Assertion 0 && "Could not implement aligned_alloc automatically. Please enable C++17 or later in your compiler or provide custom implementation of macro VMA_SYSTEM_ALIGNED_MALLOC (and VMA_SYSTEM_ALIGNED_FREE if needed) using the API of your system."' failed.
This seems to happen because the CMake project for VMA is setup for C++14, and when using GCC on Linux it needs C++17 for the aligned_alloc() function. The project I'm using VMA for is using C++20, but the setting is not propagated back to VMA's CMake project.
As an example, VulkanMemoryAllocator-Hpp links VMA this way.
My solution to this problem is overriding VMA's C++ standard after including it:
add_subdirectory(vma)
set_target_properties(VulkanMemoryAllocator PROPERTIES CXX_STANDARD 17)
I don't know how desirable it is for the VMA's CMake project to stay at C++14, if it's not a big deal then I suggest simply bumping the standard in the src/CMakeLists.txt file.
[...]/vk_mem_alloc.h:2791: void* vma_aligned_alloc(size_t, size_t): Assertion 0 && "Could not implement aligned_alloc automatically. Please enable C++17 or later in your compiler or provide custom implementation of macro VMA_SYSTEM_ALIGNED_MALLOC (and VMA_SYSTEM_ALIGNED_FREE if needed) using the API of your system."' failed.This seems to happen because the CMake project for VMA is setup for C++14, and when using GCC on Linux it needs C++17 for the
aligned_alloc()function. The project I'm using VMA for is using C++20, but the setting is not propagated back to VMA's CMake project.As an example, VulkanMemoryAllocator-Hpp links VMA this way.
My solution to this problem is overriding VMA's C++ standard after including it:
I don't know how desirable it is for the VMA's CMake project to stay at C++14, if it's not a big deal then I suggest simply bumping the standard in the src/CMakeLists.txt file.