Files
HelloVulkan/Engine/CMakeLists.txt
T
atdunbg 0de8498350 feat: 显存分配器迁移到 VMA(P1 路线第一项)
- vendored VulkanMemoryAllocator 子模块,唯一实现编译单元 VmaImpl.cpp
- MemoryAllocator 重写为 VMA 后端:接口从"Allocate(reqs)+手绑"升级为
  "创建即分配即绑定"(CreateBuffer/CreateImage/Destroy/Flush),
  VMA 要求资源与内存成对释放,约束成单一出口
- Buffer/Texture/RenderGraph 三处调用方迁移;staging 持久映射 + 按分配
  精确 flush(原来按整块 flush)
- 获得:TLSF 通用分配、DedicatedAllocation 自动启用、memory budget 感知、
  内存别名基础(TAA/复用前置)
- 编译零错误、validation 零警告、8 秒冒烟通过
2026-09-23 12:51:11 +08:00

38 lines
1.0 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
file(GLOB_RECURSE ENGINE_SOURCES
src/*.cpp
)
# ImGui(docking 分支,vendored submodule)
set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/Lib/imgui)
set(IMGUI_SOURCES
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/imgui_demo.cpp # ShowDemoWindow 的实现(调试期保留)
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp
)
# 编译成静态库
add_library(Engine STATIC ${ENGINE_SOURCES} ${IMGUI_SOURCES})
target_include_directories(Engine PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/Lib/entt/src
${CMAKE_SOURCE_DIR}/Lib/VulkanMemoryAllocator/include
${IMGUI_DIR}
${IMGUI_DIR}/backends
)
# 链接第三方库
target_link_libraries(Engine PUBLIC
glfw
Vulkan::Vulkan
spdlog::spdlog
stb
assimp::assimp
)
target_compile_definitions(Engine PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)