From e8ebf298c6ca91b0d0fd28112201fb46b3837a42 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 11 Oct 2025 12:52:09 -0400 Subject: [PATCH] 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. --- src/app/app.cmake | 5 ++++- src/app/emu/emu.cmake | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/app.cmake b/src/app/app.cmake index 7a7a1793..7ec27985 100644 --- a/src/app/app.cmake +++ b/src/app/app.cmake @@ -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) diff --git a/src/app/emu/emu.cmake b/src/app/emu/emu.cmake index e159fa5c..733463dd 100644 --- a/src/app/emu/emu.cmake +++ b/src/app/emu/emu.cmake @@ -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()