Refactor CMake configuration for core library and testing

- Updated CMakeLists.txt to create a separate core library (yaze_core) for testing, enhancing modularity.
- Adjusted source file organization for yaze_c and yaze_core, ensuring proper inclusion of essential components.
- Modified test CMakeLists.txt to link against yaze_core instead of yaze_c, streamlining dependencies for test targets.
- Disabled installation of the library in minimal builds while maintaining the ability to build for testing purposes.
This commit is contained in:
scawful
2025-09-26 15:14:52 -04:00
parent caffe59800
commit 857e75e7fe
3 changed files with 63 additions and 19 deletions

View File

@@ -32,12 +32,14 @@ option(YAZE_ENABLE_EXPERIMENTAL_TESTS "Enable experimental/unstable tests" ON)
option(YAZE_ENABLE_UI_TESTS "Enable ImGui Test Engine UI testing" ON)
option(YAZE_MINIMAL_BUILD "Minimal build for CI (disable optional features)" OFF)
# Disable optional components in minimal builds
# Configure minimal builds for CI/CD
if(YAZE_MINIMAL_BUILD)
set(YAZE_ENABLE_UI_TESTS OFF CACHE BOOL "Disabled for minimal build" FORCE)
set(YAZE_BUILD_EMU OFF CACHE BOOL "Disabled for minimal build" FORCE)
set(YAZE_BUILD_Z3ED OFF CACHE BOOL "Disabled for minimal build" FORCE)
set(YAZE_BUILD_LIB OFF CACHE BOOL "Disabled for minimal build" FORCE)
# Keep EMU and LIB enabled for comprehensive testing
set(YAZE_BUILD_EMU ON CACHE BOOL "Required for test suite" FORCE)
set(YAZE_BUILD_LIB ON CACHE BOOL "Required for test suite" FORCE)
set(YAZE_INSTALL_LIB OFF CACHE BOOL "Disabled for minimal build" FORCE)
endif()
set(YAZE_TEST_ROM_PATH "${CMAKE_BINARY_DIR}/bin/zelda3.sfc" CACHE STRING "Path to test ROM file")