Files
HelloVulkan/Engine/CMakeLists.txt
T
atdunbg 42fd9d5f30 fix: 阴影光源错误绑定 FillLight + 截图 usage 警告 + nodiscard
- LightComponent 增加 castShadow 标志;灯收集排序键改为
  castShadow 方向光 > 方向光 > 点光(此前稳定排序把收集序靠前的
  FillLight 排到 lights[0],KeyLight 方向滑条自然不影响阴影)
- TextureDesc 增加 extraUsage:HDRColor 声明 TRANSFER_SRC,
  消除截图 copy 的 3 条 usage 不匹配运行时警告
- waitForFences nodiscard 返回值显式丢弃,消除编译警告
2026-09-24 11:59:18 +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)