Update CMake configuration and .clangd settings for improved build management

- Removed unnecessary compile flags from .clangd to streamline configuration.
- Added YAZE_BUILD_LIB option in CMakeLists.txt for conditional library building in minimal builds.
- Enhanced SDL2 CMake configuration to set include directories for bundled SDL, ensuring proper integration.
- Updated test CMakeLists.txt to conditionally link yaze_c and ImGuiTestEngine based on build options, improving modularity and flexibility.
- Refactored test_editor.cc and test_editor.h to conditionally include ImGuiTestEngine headers and manage engine initialization based on availability.
This commit is contained in:
scawful
2025-09-26 13:51:02 -04:00
parent 53787872b2
commit cbce2730b6
8 changed files with 55 additions and 11 deletions

View File

@@ -46,7 +46,6 @@ add_executable(
zelda3/test_dungeon_objects.cc
${ASAR_STATIC_SRC}
${IMGUI_SRC}
${IMGUI_TEST_ENGINE_SOURCES}
${YAZE_SRC_FILES}
)
@@ -78,9 +77,13 @@ target_link_libraries(
${PNG_LIBRARIES}
${OPENGL_LIBRARIES}
${CMAKE_DL_LIBS}
yaze_c
)
# Conditionally link yaze_c only when library is built
if(YAZE_BUILD_LIB)
target_link_libraries(extract_vanilla_values yaze_c)
endif()
target_include_directories(
yaze_test PUBLIC
app/
@@ -103,14 +106,23 @@ target_link_libraries(
${PNG_LIBRARIES}
${OPENGL_LIBRARIES}
${CMAKE_DL_LIBS}
yaze_c
ImGuiTestEngine
ImGui
gmock_main
gmock
gtest_main
gtest
)
# Conditionally link yaze_c only when library is built
if(YAZE_BUILD_LIB)
target_link_libraries(yaze_test yaze_c)
endif()
# Conditionally link ImGuiTestEngine only when UI tests are enabled
if(YAZE_ENABLE_UI_TESTS)
target_link_libraries(yaze_test ${IMGUI_TEST_ENGINE_TARGET})
target_compile_definitions(yaze_test PRIVATE ${IMGUI_TEST_ENGINE_DEFINITIONS})
endif()
# ROM Testing Configuration
if(YAZE_ENABLE_ROM_TESTS)
target_compile_definitions(yaze_test PRIVATE
@@ -119,7 +131,7 @@ if(YAZE_ENABLE_ROM_TESTS)
)
endif()
target_compile_definitions(yaze_test PRIVATE "IMGUI_ENABLE_TEST_ENGINE")
# ImGui Test Engine definitions are now handled conditionally above
# Platform-specific definitions
if(UNIX AND NOT APPLE)