chore: update ImGui configuration and remove legacy CMake file
- Incremented cache revision in dependencies.lock to trigger rebuild. - Deleted obsolete imgui.cmake file to streamline project structure. - Updated imgui.cmake to set C++ standard requirement for ImGui and its test engine. Benefits: - Simplifies dependency management and ensures compatibility with C++17. - Cleans up unused files, improving project maintainability.
This commit is contained in:
@@ -21,6 +21,7 @@ set(FTXUI_VERSION "5.0.0" CACHE STRING "FTXUI version")
|
||||
|
||||
# ImGui
|
||||
set(IMGUI_VERSION "1.90.4" CACHE STRING "Dear ImGui version")
|
||||
# Cache revision: increment to force rebuild (current: 2)
|
||||
|
||||
# ASAR
|
||||
set(ASAR_VERSION "main" CACHE STRING "ASAR version")
|
||||
|
||||
@@ -25,6 +25,9 @@ target_include_directories(ImGui PUBLIC
|
||||
${IMGUI_DIR}/backends
|
||||
)
|
||||
|
||||
# Set C++ standard requirement (ImGui 1.90+ requires C++11, we use C++17 for consistency)
|
||||
target_compile_features(ImGui PUBLIC cxx_std_17)
|
||||
|
||||
# Link to SDL2
|
||||
target_link_libraries(ImGui PUBLIC ${YAZE_SDL2_TARGETS})
|
||||
|
||||
@@ -52,6 +55,7 @@ if(YAZE_BUILD_TESTS)
|
||||
${IMGUI_TEST_ENGINE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
)
|
||||
target_compile_features(ImGuiTestEngine PUBLIC cxx_std_17)
|
||||
target_link_libraries(ImGuiTestEngine PUBLIC ImGui ${YAZE_SDL2_TARGETS})
|
||||
target_compile_definitions(ImGuiTestEngine PUBLIC
|
||||
IMGUI_ENABLE_TEST_ENGINE=1
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# gui libraries ---------------------------------------------------------------
|
||||
set(IMGUI_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui)
|
||||
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp)
|
||||
set(IMGUI_BACKEND_SOURCES
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdl2.cpp
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdlrenderer2.cpp
|
||||
${IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp
|
||||
)
|
||||
add_library("ImGui" STATIC ${IMGUI_SOURCES} ${IMGUI_BACKEND_SOURCES})
|
||||
target_include_directories("ImGui" PUBLIC ${IMGUI_PATH} ${IMGUI_PATH}/backends)
|
||||
target_include_directories(ImGui PUBLIC ${SDL2_INCLUDE_DIR})
|
||||
target_compile_definitions(ImGui PUBLIC
|
||||
IMGUI_IMPL_OPENGL_LOADER_CUSTOM=<SDL2/SDL_opengl.h> GL_GLEXT_PROTOTYPES=1)
|
||||
|
||||
# ImGui Test Engine - Always built when tests are enabled for simplified integration
|
||||
# The test infrastructure is tightly coupled with the editor, so we always include it
|
||||
if(YAZE_BUILD_TESTS)
|
||||
set(IMGUI_TEST_ENGINE_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine/imgui_test_engine)
|
||||
file(GLOB IMGUI_TEST_ENGINE_SOURCES ${IMGUI_TEST_ENGINE_PATH}/*.cpp)
|
||||
add_library("ImGuiTestEngine" STATIC ${IMGUI_TEST_ENGINE_SOURCES})
|
||||
target_include_directories(ImGuiTestEngine PUBLIC ${IMGUI_PATH} ${CMAKE_SOURCE_DIR}/src/lib)
|
||||
target_link_libraries(ImGuiTestEngine PUBLIC ImGui)
|
||||
target_compile_definitions(ImGuiTestEngine PUBLIC
|
||||
IMGUI_ENABLE_TEST_ENGINE=1
|
||||
IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL=1)
|
||||
|
||||
message(STATUS "✓ ImGui Test Engine enabled (tests are ON)")
|
||||
else()
|
||||
message(STATUS "✗ ImGui Test Engine disabled (tests are OFF)")
|
||||
endif()
|
||||
|
||||
set(
|
||||
IMGUI_SRC
|
||||
${IMGUI_PATH}/imgui.cpp
|
||||
${IMGUI_PATH}/imgui_demo.cpp
|
||||
${IMGUI_PATH}/imgui_draw.cpp
|
||||
${IMGUI_PATH}/imgui_widgets.cpp
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdl2.cpp
|
||||
${IMGUI_PATH}/backends/imgui_impl_sdlrenderer2.cpp
|
||||
${IMGUI_PATH}/misc/cpp/imgui_stdlib.cpp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user