Files
HelloVulkan/Engine/CMakeLists.txt
T
atdunbg b6982d426f feat: Tracy profiler 接入(CPU 帧时间线)
- vendored tracy 子模块;TRACY_ENABLE 全局生效,宏关闭时零开销
- 插桩:Application::Run FrameMark(帧边界)、Renderer::Render、
  SceneRenderer::BuildFrame(ZoneScopedN)+ GPUDriven Collect
  (ZoneNamedN——同作用域第二个 zone 不能用 ZoneScopedN,变量名
  固定会重声明)、Scene::UpdateTransforms
- 覆盖 CPU 侧关键路径:帧时间线 / 场景收集 / transform 重算 / 录制提交
- 用法:游戏运行时打开 Tracy GUI(release 下载)即自动连接(8086 端口)
2026-09-23 16:10:46 +08:00

47 lines
1.4 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
)
# Tracy(CPU/GPU 帧分析):宏关闭时全部退化空操作,零开销
set(TRACY_DIR ${CMAKE_SOURCE_DIR}/Lib/tracy)
target_include_directories(Engine PUBLIC ${TRACY_DIR}/public)
target_sources(Engine PRIVATE ${TRACY_DIR}/public/TracyClient.cpp)
target_compile_definitions(Engine PUBLIC TRACY_ENABLE)
find_package(Threads REQUIRED)
target_link_libraries(Engine PUBLIC Threads::Threads)
target_compile_definitions(Engine PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)