Update CMake include directories for improved modularity and organization

- Refactored target_include_directories in app.cmake, emu.cmake, and z3ed.cmake to use absolute paths for better clarity and maintainability.
- Updated test_manager.cc and test_manager.h to simplify ImGui header inclusion.
- Enhanced test CMakeLists.txt to conditionally include directories for the extract_vanilla_values utility, ensuring proper integration with the new structure.
This commit is contained in:
scawful
2025-09-26 14:46:41 -04:00
parent cbce2730b6
commit 78579d2934
7 changed files with 57 additions and 44 deletions

View File

@@ -57,9 +57,11 @@ endif()
target_include_directories(
yaze PUBLIC
lib/
app/
${ASAR_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/src/app/
${CMAKE_SOURCE_DIR}/src/lib/asar/src
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine

View File

@@ -34,8 +34,11 @@ endif()
target_include_directories(
yaze_emu PUBLIC
lib/
app/
${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/src/app/
${CMAKE_SOURCE_DIR}/src/lib/asar/src
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${PNG_INCLUDE_DIRS}

View File

@@ -6,7 +6,7 @@
#include "app/core/platform/file_dialog.h"
#include "app/gfx/arena.h"
#include "app/gui/icons.h"
#include "imgui/imgui.h"
#include "imgui.h"
#include "util/log.h"
// Forward declaration to avoid circular dependency

View File

@@ -10,7 +10,7 @@
#include "absl/status/status.h"
#include "app/rom.h"
#include "imgui/imgui.h"
#include "imgui.h"
#include "util/log.h"
// Forward declarations

View File

@@ -33,9 +33,11 @@ add_executable(
target_include_directories(
z3ed PUBLIC
lib/
app/
${ASAR_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/src/app/
${CMAKE_SOURCE_DIR}/src/lib/asar/src
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${PNG_INCLUDE_DIRS}

View File

@@ -49,50 +49,56 @@ add_executable(
${YAZE_SRC_FILES}
)
# Add vanilla value extraction utility
add_executable(
extract_vanilla_values
zelda3/extract_vanilla_values.cc
${YAZE_SRC_FILES}
)
# Add vanilla value extraction utility (only for local development with ROM access)
if(NOT YAZE_MINIMAL_BUILD AND YAZE_ENABLE_ROM_TESTS)
add_executable(
extract_vanilla_values
zelda3/extract_vanilla_values.cc
${YAZE_SRC_FILES}
)
target_include_directories(
extract_vanilla_values PUBLIC
app/
lib/
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
${ASAR_INCLUDE_DIR}
${SDL2_INCLUDE_DIR}
${PNG_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}
)
target_include_directories(
extract_vanilla_values PUBLIC
${CMAKE_SOURCE_DIR}/src/app/
${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
${CMAKE_SOURCE_DIR}/src/lib/asar/src
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
${SDL2_INCLUDE_DIR}
${PNG_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}
)
target_link_libraries(
extract_vanilla_values
${SDL_TARGETS}
asar-static
${ABSL_TARGETS}
${PNG_LIBRARIES}
${OPENGL_LIBRARIES}
${CMAKE_DL_LIBS}
)
target_link_libraries(
extract_vanilla_values
${SDL_TARGETS}
asar-static
${ABSL_TARGETS}
${PNG_LIBRARIES}
${OPENGL_LIBRARIES}
${CMAKE_DL_LIBS}
)
# Conditionally link yaze_c only when library is built
if(YAZE_BUILD_LIB)
target_link_libraries(extract_vanilla_values yaze_c)
# Conditionally link yaze_c only when library is built
if(YAZE_BUILD_LIB)
target_link_libraries(extract_vanilla_values yaze_c)
endif()
endif()
target_include_directories(
yaze_test PUBLIC
app/
lib/
${CMAKE_SOURCE_DIR}/src/app/
${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/test/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
${ASAR_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/lib/asar/src
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
${SDL2_INCLUDE_DIR}
${PNG_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}

View File

@@ -7,7 +7,7 @@
#include "app/gui/style.h"
#include "imgui/backends/imgui_impl_sdl2.h"
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
#include "imgui/imgui.h"
#include "imgui.h"
#ifdef IMGUI_ENABLE_TEST_ENGINE
#include "imgui_test_engine/imgui_te_context.h"