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( target_include_directories(
yaze PUBLIC yaze PUBLIC
lib/ ${CMAKE_SOURCE_DIR}/src/lib/
app/ ${CMAKE_SOURCE_DIR}/src/app/
${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
${CMAKE_SOURCE_DIR}/incl/ ${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine ${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine

View File

@@ -34,8 +34,11 @@ endif()
target_include_directories( target_include_directories(
yaze_emu PUBLIC yaze_emu PUBLIC
lib/ ${CMAKE_SOURCE_DIR}/src/lib/
app/ ${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}/incl/
${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/src/
${PNG_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}

View File

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

View File

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

View File

@@ -33,9 +33,11 @@ add_executable(
target_include_directories( target_include_directories(
z3ed PUBLIC z3ed PUBLIC
lib/ ${CMAKE_SOURCE_DIR}/src/lib/
app/ ${CMAKE_SOURCE_DIR}/src/app/
${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
${CMAKE_SOURCE_DIR}/incl/ ${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/src/
${PNG_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}

View File

@@ -49,27 +49,30 @@ add_executable(
${YAZE_SRC_FILES} ${YAZE_SRC_FILES}
) )
# Add vanilla value extraction utility # Add vanilla value extraction utility (only for local development with ROM access)
add_executable( if(NOT YAZE_MINIMAL_BUILD AND YAZE_ENABLE_ROM_TESTS)
add_executable(
extract_vanilla_values extract_vanilla_values
zelda3/extract_vanilla_values.cc zelda3/extract_vanilla_values.cc
${YAZE_SRC_FILES} ${YAZE_SRC_FILES}
) )
target_include_directories( target_include_directories(
extract_vanilla_values PUBLIC extract_vanilla_values PUBLIC
app/ ${CMAKE_SOURCE_DIR}/src/app/
lib/ ${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/incl/ ${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine ${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine
${ASAR_INCLUDE_DIR} ${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} ${SDL2_INCLUDE_DIR}
${PNG_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}
) )
target_link_libraries( target_link_libraries(
extract_vanilla_values extract_vanilla_values
${SDL_TARGETS} ${SDL_TARGETS}
asar-static asar-static
@@ -77,22 +80,25 @@ target_link_libraries(
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${CMAKE_DL_LIBS} ${CMAKE_DL_LIBS}
) )
# Conditionally link yaze_c only when library is built # Conditionally link yaze_c only when library is built
if(YAZE_BUILD_LIB) if(YAZE_BUILD_LIB)
target_link_libraries(extract_vanilla_values yaze_c) target_link_libraries(extract_vanilla_values yaze_c)
endif()
endif() endif()
target_include_directories( target_include_directories(
yaze_test PUBLIC yaze_test PUBLIC
app/ ${CMAKE_SOURCE_DIR}/src/app/
lib/ ${CMAKE_SOURCE_DIR}/src/lib/
${CMAKE_SOURCE_DIR}/incl/ ${CMAKE_SOURCE_DIR}/incl/
${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/src/
${CMAKE_SOURCE_DIR}/test/ ${CMAKE_SOURCE_DIR}/test/
${CMAKE_SOURCE_DIR}/src/lib/imgui_test_engine ${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} ${SDL2_INCLUDE_DIR}
${PNG_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}
${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}

View File

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