Skip to content
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0dc4edc
VMA v3.3.0
YaaZ Sep 2, 2025
9d69a3d
Revert pair for correct destruction order
YaaZ Sep 3, 2025
55f45b2
🥸
YaaZ Sep 11, 2025
438a59b
🤡
YaaZ Oct 8, 2025
c0df360
Well I've been to Hastings and I've been to Brighton
YaaZ Oct 14, 2025
e26b644
I've been to Eastbourne too
YaaZ Oct 14, 2025
b84423c
So what?
YaaZ Oct 15, 2025
f4b2c31
So what???
YaaZ Oct 15, 2025
c213191
👹
YaaZ Oct 15, 2025
f9de18e
Destructor deduction
YaaZ Oct 16, 2025
997ffd9
Updated handle generation
YaaZ Oct 19, 2025
f90825b
Custom result checks
YaaZ Oct 19, 2025
3c1465f
Short destructor variants
YaaZ Oct 19, 2025
723d737
Doc comments
YaaZ Oct 19, 2025
694af70
Convert array size constants
YaaZ Oct 19, 2025
fea4f6e
Noexcept methods
YaaZ Oct 20, 2025
6cbbdd3
RAII handles
YaaZ Oct 20, 2025
66b9bd2
More RAII handles
YaaZ Oct 20, 2025
07948f2
Even more RAII handles
YaaZ Oct 21, 2025
237fea5
RAII method stubs
YaaZ Oct 21, 2025
5758368
RAII method signatures
YaaZ Oct 21, 2025
01bb698
Refactor Segment
YaaZ Oct 22, 2025
4137c82
Refactor types
YaaZ Oct 22, 2025
76d292d
Plain handle params for RAII methods
YaaZ Oct 22, 2025
2dc6899
RAII method definitions
YaaZ Oct 23, 2025
d50315e
Better (or worse?) RAII wrappers
YaaZ Oct 23, 2025
b239c50
RAII VULKAN_HPP_DISABLE_ENHANCED_MODE
YaaZ Oct 23, 2025
14d0991
RAII handle constructors
YaaZ Oct 24, 2025
27bd84d
Const ref Optionals
YaaZ Oct 24, 2025
b8c4c58
Nodiscard RAII getters
YaaZ Oct 24, 2025
c1d911a
Handle type refactoring
YaaZ Oct 24, 2025
0890887
RAII output type refactoring
YaaZ Oct 24, 2025
411f461
Unique output type refactoring
YaaZ Oct 24, 2025
1e4e8e6
Combining RAII methods
YaaZ Oct 24, 2025
64790de
Even worse RAII wrappers
YaaZ Oct 26, 2025
b9f489d
RAII combining constructors
YaaZ Oct 26, 2025
2920c74
Cleanup
YaaZ Oct 26, 2025
227adb3
RAII operators
YaaZ Oct 26, 2025
92dee90
MSVC & Modules
YaaZ Oct 27, 2025
e363a57
VULKAN_HPP_CONSTEXPR_INLINE
YaaZ Oct 27, 2025
1ca0c31
Generated functionsFromDispatcher
YaaZ Nov 9, 2025
3d7d104
Align modules with Vulkan-Hpp
YaaZ Nov 9, 2025
4a152f3
fixup! Align modules with Vulkan-Hpp
YaaZ Nov 9, 2025
76c4612
Update submodule
YaaZ Nov 9, 2025
eb535c1
VMA_HPP_ENABLE_INSTALL
YaaZ Nov 9, 2025
2829ff3
Refactor exported symbols
YaaZ Nov 9, 2025
b6474e7
More samples
YaaZ Nov 9, 2025
3b31142
VULKAN_HPP_NO_CONSTRUCTORS
YaaZ Nov 9, 2025
3ecea76
Update readme
YaaZ Nov 10, 2025
56b7bd6
Workflows
YaaZ Nov 10, 2025
f4fff0a
Enable releases
YaaZ Nov 12, 2025
08a4ff9
Escape semicolons when updating the README
YaaZ Nov 12, 2025
e153ff1
Samples
YaaZ Nov 12, 2025
87f3d59
Refactor stats string destruction for MSVC modules
YaaZ Nov 12, 2025
861b0a2
Refactor stats string destruction for MSVC modules
YaaZ Nov 12, 2025
7f61e3a
Use promoted versions of extension functions in functionsFromDispatchers
YaaZ Nov 13, 2025
4448103
Vulkan 1.4.333
YaaZ Nov 14, 2025
9fbb06b
Build scripts & dependencies
YaaZ Nov 14, 2025
06ae976
fixup! Build scripts & dependencies
YaaZ Nov 17, 2025
c9057f3
Vulkan-Headers 1.4.334
YaaZ Nov 17, 2025
1d00340
Update CMakeLists.txt
YaaZ Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build
on:
workflow_dispatch:
workflow_call:
pull_request:
jobs:
build:
name: ${{matrix.env.os}} ${{matrix.env.name || matrix.env.c}} ${{matrix.env.modules && 'cppm' || 'cpp'}}-${{matrix.standard}}
runs-on: ${{matrix.env.os}}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
env: [
{ os: macos-15, cxx: clang++, name: apple-clang },
# { os: macos-15, cxx: /opt/homebrew/opt/llvm/bin/clang++, name: clang, cxx_flags: '-I/opt/homebrew/opt/llvm/include/c++/v1 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk', linker_flags: '-L/opt/homebrew/opt/llvm/lib/c++', modules: true }, # TODO Enable when https://github.com/YaaZ/VulkanMemoryAllocator-Hpp/issues/65 is fixed
{ os: ubuntu-24.04, cxx: clang++-16, c: clang-16 },
{ os: ubuntu-24.04, cxx: clang++-17, c: clang-17 },
{ os: ubuntu-24.04, cxx: clang++-18, c: clang-18 },
# { os: ubuntu-24.04, cxx: clang++-18, c: clang-18, cxx_flags: '-stdlib=libc++', linker_flags: '-stdlib=libc++ -lc++abi', modules: true }, # TODO Enable when https://github.com/KhronosGroup/Vulkan-Hpp/pull/2357 is fixed
{ os: ubuntu-24.04, cxx: g++-12, c: gcc-12 },
{ os: ubuntu-24.04, cxx: g++-13, c: gcc-13 },
{ os: ubuntu-24.04, cxx: g++-14, c: gcc-14 },
{ os: windows-2025, name: msvc },
{ os: windows-2025, name: msvc, modules: true, extra_flags: '-DVMA_HPP_SAMPLES_BUILD=OFF' }, # TODO Build samples when MSVC stops failing with ICE
{ os: windows-2025, cxx: clang-cl, c: clang-cl, cxx_flags: '//EHsc' },
{ os: windows-2025, cxx: c++, c: cc, name: gcc },
]
standard: [ 11, 14, 17, 20, 23 ]
exclude:
- env:
modules: true
standard: 11
- env:
modules: true
standard: 14
- env:
modules: true
standard: 17
- env:
modules: true
standard: 20
- env:
cxx: clang++-17
standard: 23
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: true
- name: Setup CMake and Ninja
if: matrix.env.modules
uses: lukka/get-cmake@latest
with:
cmakeVersion: 4.1.2
ninjaVersion: latest
- name: Setup MSVC
if: contains(matrix.env.os, 'windows') && matrix.env.name == 'msvc'
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: Setup libc
if: contains(matrix.env.os, 'ubuntu') && matrix.env.modules
run: sudo apt install libc++-dev libc++abi-dev
- name: Setup libc & fix 'import std'
if: contains(matrix.env.os, 'macos') && matrix.env.modules
run: |
brew install llvm
# export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
CMAKE_FIX=`which cmake`
CMAKE_FIX="`dirname $CMAKE_FIX`/../share/cmake-4.1/Modules/Compiler/Clang-CXX-CXXImportStd.cmake"
sed -i '' 's|\${_clang_modules_json_impl}.modules.json|/opt/homebrew/opt/llvm/lib/c++/libc++.modules.json|g' $CMAKE_FIX # https://gitlab.kitware.com/cmake/cmake/-/issues/25965#note_1523575
- name: Build
run: |
CXX_FLAGS="${{matrix.env.cxx_flags || ''}}"
FLAGS=(
-B build -G Ninja --fresh
-DVMA_HPP_GENERATOR_BUILD=OFF
-DVMA_HPP_RUN_GENERATOR=OFF
-DCMAKE_CXX_STANDARD=${{matrix.standard}}
-DCMAKE_BUILD_TYPE=Release
${{matrix.env.cxx && format('-DCMAKE_CXX_COMPILER={0}', matrix.env.cxx)}}
${{matrix.env.c && format('-DCMAKE_C_COMPILER={0}', matrix.env.c)}}
${{matrix.env.linker_flags && format('-DCMAKE_EXE_LINKER_FLAGS=''{0}''', matrix.env.linker_flags)}}
${{matrix.env.modules && '-DCMAKE_EXPERIMENTAL_CXX_IMPORT_STD=d0edc3af-4c50-42ea-a356-e2862fe7a444' || ''}}
${{matrix.env.extra_flags || ''}}
)

cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS"
cmake --build build --clean-first

cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS -DVULKAN_HPP_NO_EXCEPTIONS -DVULKAN_HPP_USE_REFLECT"
cmake --build build --clean-first

mv VulkanMemoryAllocator/include/vk_mem_alloc.h include
cmake "${FLAGS[@]}" -DCMAKE_CXX_FLAGS="$CXX_FLAGS"
cmake --build build --clean-first

${{matrix.env.modules && 'ls build/include/CMakeFiles | grep VulkanMemoryAllocator-HppModule &> /dev/null || (echo "VulkanMemoryAllocator-HppModule was not built"; exit 1)'}}
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,58 @@ name: Release
on:
workflow_dispatch:
jobs:
build:
uses: ./.github/workflows/build.yml
release:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
build
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: true
fetch-tags: true
- name: Package
id: package
run: |
cmake -B build || true
VERSION=`cat build/CMakeCache.txt | grep VMA_HPP_PROJECT_VERSION | cut -d= -f2`
echo "VMA version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT

git fetch --unshallow --tags --recurse-submodules=no
BUILD=`git tag -l --sort=-version:refname | grep $VERSION | head -n 1 | cut -d+ -f2`
BUILD=$((BUILD+1))
echo "Build number: $BUILD"
echo "build=$BUILD" >> $GITHUB_OUTPUT

cp VulkanMemoryAllocator/include/vk_mem_alloc.h include
mv include vma-hpp
tar czf VulkanMemoryAllocator-Hpp-$VERSION.tar.gz vma-hpp
- name: Release
uses: actions/[email protected]
with:
script: |
const tar = 'VulkanMemoryAllocator-Hpp-${{ steps.package.outputs.version }}.tar.gz'
const response = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'v${{ steps.package.outputs.version }}',
tag_name: 'v${{ steps.package.outputs.version }}+${{ steps.package.outputs.build }}',
target_commitish: '${{ github.ref_name }}',
draft: true,
prerelease: false,
generate_release_notes: true,
});
var fs = require('fs');
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
url: response.data.upload_url,
headers: { "content-type": "application/java-archive" },
name: tar,
data: fs.readFileSync(tar),
});
162 changes: 134 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,142 @@
cmake_minimum_required(VERSION 3.6...3.30 FATAL_ERROR)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "0e5b6991-d74f-4b3d-a41c-cf096e0b2508")
cmake_minimum_required(VERSION 3.8...3.30 FATAL_ERROR)

project(
VulkanMemoryAllocator-Hpp
VERSION 3.1.0
DESCRIPTION "C++ bindings for the VulkanMemoryAllocator library."
LANGUAGES C CXX)

add_library(VulkanMemoryAllocator-Hpp INTERFACE)
add_library(VulkanMemoryAllocator-Hpp::VulkanMemoryAllocator-Hpp ALIAS VulkanMemoryAllocator-Hpp)

option(VMA_BUILD_CXX_MODULE OFF)
if (${VMA_BUILD_CXX_MODULE})
add_subdirectory(CppModule)
endif()

target_include_directories(VulkanMemoryAllocator-Hpp INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
project(VulkanMemoryAllocator-Hpp-Generator VERSION 3.3.0 LANGUAGES CXX)

if (CMAKE_VERSION VERSION_LESS "3.21")
# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html
string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL)
endif()
endif ()

option(VMA_HPP_GENERATOR_BUILD "Build the HPP generator" ${PROJECT_IS_TOP_LEVEL})
option(VMA_HPP_RUN_GENERATOR "Run the HPP generator" ${PROJECT_IS_TOP_LEVEL})
option(VMA_HPP_SAMPLES_BUILD "Build samples" ${PROJECT_IS_TOP_LEVEL})
option(VMA_HPP_DO_UPDATE "Update Vulkan & VMA versions" OFF)
set(VMA_HPP_INPUT_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/VulkanMemoryAllocator/include/vk_mem_alloc.h" CACHE FILEPATH "Input vk_mem_alloc.h file")
set(VMA_HPP_VMA_SUBMODULE "v${PROJECT_VERSION}" CACHE STRING "VulkanMemoryAllocator submodule revision" FORCE)
set(VMA_HPP_VULKAN_SUBMODULE "main" CACHE STRING "Vulkan-Hpp submodule revision")

if (VMA_HPP_DO_UPDATE
OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VulkanMemoryAllocator/.git"
OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/.git")
# Init submodules.
find_package(Git)
if (Git_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMAND_ERROR_IS_FATAL ANY)
elseif (VMA_HPP_DO_UPDATE)
message(FATAL_ERROR "Git not found. VMA_HPP_DO_UPDATE is not available.")
else ()
message(FATAL_ERROR "Git not found. You need to init submodules manually (`git submodule update`).")
endif ()
endif ()

if (VMA_HPP_DO_UPDATE)
# Checkout proper revisions.
message("-- Updating VulkanMemoryAllocator submodule to ${VMA_HPP_VMA_SUBMODULE}")
execute_process(COMMAND ${GIT_EXECUTABLE} -c advice.detachedHead=false checkout "${VMA_HPP_VMA_SUBMODULE}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/VulkanMemoryAllocator" COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND ${GIT_EXECUTABLE} pull
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/VulkanMemoryAllocator" ERROR_QUIET)
message("-- Updating Vulkan-Headers submodule to ${VMA_HPP_VULKAN_SUBMODULE}")
execute_process(COMMAND ${GIT_EXECUTABLE} -c advice.detachedHead=false checkout "${VMA_HPP_VULKAN_SUBMODULE}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers" COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND ${GIT_EXECUTABLE} pull
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers" ERROR_QUIET)
endif ()

add_subdirectory(Vulkan-Headers)
add_subdirectory(VulkanMemoryAllocator)
add_subdirectory(include)

if (NOT ${PROJECT_VERSION} STREQUAL ${VMA_HPP_PROJECT_VERSION})
message(FATAL_ERROR "VulkanMemoryAllocator-Hpp-Generator and VulkanMemoryAllocator-Hpp versions do not match (${PROJECT_VERSION} vs ${VMA_HPP_PROJECT_VERSION})")
endif ()

if (VMA_HPP_DO_UPDATE)
# Find VMA and Vulkan versions from VMA header.
file(READ "${VMA_HPP_INPUT_HEADER}" VMA_HPP_VMA_SOURCE)
string(REGEX MATCH "<b>Version\\s*([^<]+)\\s*</b>" _ ${VMA_HPP_VMA_SOURCE})
string(STRIP ${CMAKE_MATCH_1} VMA_HPP_VMA_VERSION)
string(REGEX MATCHALL "VK_VERSION_([0-9]+)_([0-9]+)" VMA_HPP_VULKAN_VERSION ${VMA_HPP_VMA_SOURCE})
list(SORT VMA_HPP_VULKAN_VERSION COMPARE NATURAL ORDER DESCENDING)
list(GET VMA_HPP_VULKAN_VERSION 0 VMA_HPP_VULKAN_VERSION)
string(REGEX REPLACE "VK_VERSION_([0-9]+)_([0-9]+)" "\\1.\\2" VMA_HPP_VULKAN_VERSION ${VMA_HPP_VULKAN_VERSION})

# Update versions in README.
message("-- Updating README with VMA ${VMA_HPP_VMA_VERSION} and Vulkan ${VMA_HPP_VULKAN_VERSION}")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/README.md" VMA_HPP_README)
string(REPLACE ";" "\\;" VMA_HPP_README "${VMA_HPP_README}") # Do not mess up semicolons in the README
string(REGEX REPLACE "<!--VER-->[^<]*<!--/VER-->" "<!--VER-->${VMA_HPP_VMA_VERSION}<!--/VER-->" VMA_HPP_README "${VMA_HPP_README}")
string(REGEX REPLACE "<!--VK-->[^<]*<!--/VK-->" "<!--VK-->${VMA_HPP_VULKAN_VERSION}<!--/VK-->" VMA_HPP_README "${VMA_HPP_README}")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/README.md" ${VMA_HPP_README})

# Generate "imported" utility header.
set(VMA_HPP_IMPORTED_HEADER "// Generated from the list of VMA-Hpp headers (vk_mem_alloc*.hpp).
// See https://clang.llvm.org/docs/StandardCPlusPlusModules.html#providing-a-header-to-skip-parsing-redundant-headers")
file(GLOB VMA_HPP_HEADER_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/include/vk_mem_alloc*.hpp")
foreach(VMA_HPP_HEADER_FILE ${VMA_HPP_HEADER_FILES})
if (NOT ${VMA_HPP_HEADER_FILE} STREQUAL "vk_mem_alloc_imported.hpp" AND
NOT ${VMA_HPP_HEADER_FILE} STREQUAL "vk_mem_alloc_static_assertions.hpp")
string(REGEX MATCH "vk_mem_alloc(.*)\.hpp" _ ${VMA_HPP_HEADER_FILE})
string(TOUPPER "${CMAKE_MATCH_1}" VMA_HPP_HEADER_GUARD)
string(APPEND VMA_HPP_IMPORTED_HEADER "

#ifndef VULKAN_MEMORY_ALLOCATOR${VMA_HPP_HEADER_GUARD}_HPP
#define VULKAN_MEMORY_ALLOCATOR${VMA_HPP_HEADER_GUARD}_HPP
#endif")
endif ()
endforeach()
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/include/vk_mem_alloc_imported.hpp" ${VMA_HPP_IMPORTED_HEADER})
endif ()

if (VMA_HPP_GENERATOR_BUILD)
add_executable(VmaHppGenerator VmaHppGenerator.cpp)
set_property(TARGET VmaHppGenerator PROPERTY CXX_STANDARD 17)
set_property(TARGET VmaHppGenerator PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET VmaHppGenerator PROPERTY CXX_EXTENSIONS OFF)
target_compile_definitions(VmaHppGenerator PRIVATE BASE_PATH="${CMAKE_CURRENT_SOURCE_DIR}")
endif ()

if (VMA_HPP_RUN_GENERATOR)
# Find generated files.
set(VMA_HPP_GENERATED_FILES "")
file(GLOB VMA_HPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/vk_mem_alloc*")
foreach(VMA_HPP_FILE ${VMA_HPP_FILES})
file(STRINGS ${VMA_HPP_FILE} VMA_HPP_FILE_GENERATED LIMIT_COUNT 1 REGEX "// Generated .*")
if (VMA_HPP_FILE_GENERATED)
list(APPEND VMA_HPP_GENERATED_FILES ${VMA_HPP_FILE})
endif ()
endforeach()

option(VMA_HPP_ENABLE_INSTALL "Install VulkanMemoryAllocator-Hpp" ${PROJECT_IS_TOP_LEVEL})
if (VMA_HPP_ENABLE_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
add_custom_command(
COMMAND VmaHppGenerator
OUTPUT ${VMA_HPP_GENERATED_FILES}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Running VmaHppGenerator"
DEPENDS VmaHppGenerator "${VMA_HPP_INPUT_HEADER}")
add_custom_target(GenerateVmaHpp DEPENDS ${VMA_HPP_GENERATED_FILES})
add_dependencies(VulkanMemoryAllocator-Hpp GenerateVmaHpp)
endif ()

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS VulkanMemoryAllocator-Hpp EXPORT VulkanMemoryAllocator-HppConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT VulkanMemoryAllocator-HppConfig NAMESPACE "VulkanMemoryAllocator-Hpp::" DESTINATION "share/cmake/VulkanMemoryAllocator-Hpp")
if (VMA_HPP_SAMPLES_BUILD)
if (TARGET VulkanMemoryAllocator-HppModule)
add_library(VulkanMemoryAllocator-Hpp-Samples STATIC)
target_link_libraries(VulkanMemoryAllocator-Hpp-Samples PUBLIC VulkanMemoryAllocator-HppModule Vulkan::HppModule)
target_compile_definitions(VulkanMemoryAllocator-Hpp-Samples PUBLIC USE_MODULES)
target_compile_definitions(VulkanMemoryAllocator-HppModule PUBLIC VK_NO_PROTOTYPES)
target_compile_definitions(Vulkan-HppModule PUBLIC VK_NO_PROTOTYPES)
target_compile_features(VulkanMemoryAllocator-Hpp-Samples PUBLIC cxx_std_23)
else ()
add_library(VulkanMemoryAllocator-Hpp-Samples INTERFACE)
target_link_libraries(VulkanMemoryAllocator-Hpp-Samples INTERFACE VulkanMemoryAllocator-Hpp GPUOpen::VulkanMemoryAllocator Vulkan::Headers)
target_compile_definitions(VulkanMemoryAllocator-Hpp-Samples INTERFACE VK_NO_PROTOTYPES)
endif ()

write_basic_package_version_file(VulkanMemoryAllocator-HppConfigVersion.cmake COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/VulkanMemoryAllocator-HppConfigVersion.cmake" DESTINATION "share/cmake/VulkanMemoryAllocator-Hpp")
endif()
file(GLOB VMA_HPP_SAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/samples" "${CMAKE_CURRENT_SOURCE_DIR}/samples/*.cpp")
foreach(VMA_HPP_SAMPLE_FILE ${VMA_HPP_SAMPLES})
string(REPLACE ".cpp" "" VMA_HPP_SAMPLE_NAME ${VMA_HPP_SAMPLE_FILE})
set(VMA_HPP_SAMPLE_NAME "Sample_${VMA_HPP_SAMPLE_NAME}")
add_executable(${VMA_HPP_SAMPLE_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/samples/${VMA_HPP_SAMPLE_FILE}")
target_link_libraries(${VMA_HPP_SAMPLE_NAME} PRIVATE VulkanMemoryAllocator-Hpp-Samples)
endforeach()
endif ()
Loading