chore(cmake): refine test support linkage for yaze and yaze_emu

- Updated CMake configuration to conditionally link the yaze_test_support library for both yaze and yaze_emu targets, ensuring proper integration with TestManager.
- Enhanced status messages to provide clearer feedback on the linkage status and potential issues if the target is not found.

Benefits:
- Improved clarity and maintainability of the CMake configuration.
- Enhanced modularity by managing test dependencies more effectively.
This commit is contained in:
scawful
2025-10-11 13:31:29 -04:00
parent e523ce94da
commit 0a4b17fdd0
3 changed files with 12 additions and 8 deletions

View File

@@ -71,7 +71,10 @@ if(YAZE_BUILD_APP OR YAZE_BUILD_Z3ED OR YAZE_BUILD_TESTS)
include(cli/agent.cmake)
endif()
if(YAZE_BUILD_TESTS AND NOT YAZE_MINIMAL_BUILD)
# Include test support library when tests are enabled OR in non-minimal builds
# (yaze_editor needs TestManager for editor features)
# Test executables are only built when YAZE_BUILD_TESTS=ON (handled in test/CMakeLists.txt)
if(YAZE_BUILD_TESTS OR NOT YAZE_MINIMAL_BUILD)
include(app/test/test.cmake)
endif()

View File

@@ -41,14 +41,12 @@ target_link_libraries(yaze PRIVATE
absl::flags_parse
)
# Link test support if tests are enabled (yaze_editor needs TestManager)
if(YAZE_BUILD_TESTS AND TARGET yaze_test_support)
# Link test support library (yaze_editor needs TestManager)
if(TARGET yaze_test_support)
target_link_libraries(yaze PRIVATE yaze_test_support)
message(STATUS "✓ yaze executable linked to yaze_test_support")
else()
if(YAZE_BUILD_TESTS)
message(WARNING "yaze needs yaze_test_support but TARGET yaze_test_support not found")
endif()
message(WARNING "yaze needs yaze_test_support but TARGET not found")
endif()
# Platform-specific settings

View File

@@ -26,9 +26,12 @@ if(YAZE_BUILD_EMU AND NOT YAZE_MINIMAL_BUILD)
absl::failure_signal_handler
)
# Link test support if tests are enabled (yaze_editor needs TestManager)
if(YAZE_BUILD_TESTS AND TARGET yaze_test_support)
# Link test support library (yaze_editor needs TestManager)
if(TARGET yaze_test_support)
target_link_libraries(yaze_emu PRIVATE yaze_test_support)
message(STATUS "✓ yaze_emu executable linked to yaze_test_support")
else()
message(WARNING "yaze_emu needs yaze_test_support but TARGET not found")
endif()
if(YAZE_ENABLE_UI_TESTS)