From d2e35dc64529598d73e2fe1d8ed6d7f12248a539 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 18 Oct 2025 13:14:19 -0400 Subject: [PATCH] chore: enhance CMake linking for yaze_agent in test suites - Updated CMake configuration to conditionally apply whole-archive linking for the `yaze_agent` target on Unix-like systems, ensuring all necessary symbols are included. - Maintained standard linking for Windows while improving compatibility across platforms. Benefits: - Increases build stability and ensures proper symbol inclusion for test support libraries, reducing potential linker errors. --- src/app/test/test.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/test/test.cmake b/src/app/test/test.cmake index a1ebdd79..7f6d5abe 100644 --- a/src/app/test/test.cmake +++ b/src/app/test/test.cmake @@ -70,7 +70,19 @@ endif() # Link agent library if available (for z3ed test suites) # yaze_agent contains all the CLI service code (tile16_proposal_generator, gui_automation_client, etc.) if(TARGET yaze_agent) - target_link_libraries(yaze_test_support PUBLIC yaze_agent) + # Use whole-archive on Unix to ensure agent symbols (GuiAutomationClient etc) are included + if(APPLE) + target_link_options(yaze_test_support PUBLIC + "LINKER:-force_load,$") + target_link_libraries(yaze_test_support PUBLIC yaze_agent) + elseif(UNIX) + target_link_libraries(yaze_test_support PUBLIC + -Wl,--whole-archive yaze_agent -Wl,--no-whole-archive) + else() + # Windows: Normal linking + target_link_libraries(yaze_test_support PUBLIC yaze_agent) + endif() + if(YAZE_WITH_GRPC) message(STATUS "✓ z3ed test suites enabled with gRPC support") else()