chore(cmake): link test support conditionally for yaze and yaze_emu

- Added conditional linkage of the yaze_test_support library for both yaze and yaze_emu targets when tests are enabled, ensuring proper integration with TestManager.
- This change enhances the modularity of the CMake configuration by managing test dependencies more effectively.

Benefits:
- Improved organization of test support linkage in the CMake configuration.
- Enhanced maintainability by ensuring that test dependencies are only included when necessary.
This commit is contained in:
scawful
2025-10-11 12:52:09 -04:00
parent 65acd6a941
commit e8ebf298c6
2 changed files with 9 additions and 1 deletions

View File

@@ -41,7 +41,10 @@ target_link_libraries(yaze PRIVATE
absl::flags_parse
)
# Note: yaze gets yaze_test_support transitively through yaze_editor when tests are enabled
# Link test support if tests are enabled (yaze_editor needs TestManager)
if(YAZE_BUILD_TESTS AND TARGET yaze_test_support)
target_link_libraries(yaze PRIVATE yaze_test_support)
endif()
# Platform-specific settings
if(WIN32)

View File

@@ -26,6 +26,11 @@ 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)
target_link_libraries(yaze_emu PRIVATE yaze_test_support)
endif()
if(YAZE_ENABLE_UI_TESTS)
target_compile_definitions(yaze_emu PRIVATE YAZE_ENABLE_IMGUI_TEST_ENGINE=1)
endif()