Enhance ImGui library integration and CMake configuration
- Added backend source files for ImGui, improving functionality with SDL2. - Updated CMakeLists.txt to conditionally create the yaze_c library as static or shared based on the YAZE_MINIMAL_BUILD flag. - Streamlined test linking by ensuring yaze_test links against yaze_core instead of yaze_c, enhancing modularity.
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
# gui libraries ---------------------------------------------------------------
|
||||
set(IMGUI_PATH ${CMAKE_SOURCE_DIR}/src/lib/imgui)
|
||||
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp)
|
||||
add_library("ImGui" STATIC ${IMGUI_SOURCES})
|
||||
target_include_directories("ImGui" PUBLIC ${IMGUI_PATH})
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user