# Dear ImGui (docking) + SDL3 / SDL_Renderer / SDL_GPU backends.
add_library(imgui STATIC
  imgui.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp imgui_stacklayout.cpp
  backends/imgui_impl_sdl3.cpp backends/imgui_impl_sdlrenderer3.cpp backends/imgui_impl_sdlgpu3.cpp)
target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/backends)
target_link_libraries(imgui PUBLIC walkenv_sdl)
target_compile_definitions(imgui PUBLIC IMGUI_USE_WCHAR32)  # emoji (tag icons) are above U+FFFF
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_TEST_ENGINE)  # the MCP's view of every widget (editor/mcp/mcp_tools_ui.cpp: off unless a tool asks)
if(NOT MSVC)
  target_compile_options(imgui PRIVATE -w)
endif()

# The runners' copy (forms a game shows in a window: engine/forms/ui/): the same code without the editor's test-engine hooks,
# which only the editor implements, and without the GPU backend.
add_library(imgui_runtime STATIC
  imgui.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp imgui_stacklayout.cpp backends/imgui_impl_sdl3.cpp backends/imgui_impl_sdlrenderer3.cpp)
target_include_directories(imgui_runtime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/backends)
target_link_libraries(imgui_runtime PUBLIC walkenv_sdl)
target_compile_definitions(imgui_runtime PUBLIC IMGUI_USE_WCHAR32)
if(NOT MSVC)
  target_compile_options(imgui_runtime PRIVATE -w)
endif()
