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:
@@ -71,7 +71,10 @@ if(YAZE_BUILD_APP OR YAZE_BUILD_Z3ED OR YAZE_BUILD_TESTS)
|
|||||||
include(cli/agent.cmake)
|
include(cli/agent.cmake)
|
||||||
endif()
|
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)
|
include(app/test/test.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -41,14 +41,12 @@ target_link_libraries(yaze PRIVATE
|
|||||||
absl::flags_parse
|
absl::flags_parse
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link test support if tests are enabled (yaze_editor needs TestManager)
|
# Link test support library (yaze_editor needs TestManager)
|
||||||
if(YAZE_BUILD_TESTS AND TARGET yaze_test_support)
|
if(TARGET yaze_test_support)
|
||||||
target_link_libraries(yaze PRIVATE yaze_test_support)
|
target_link_libraries(yaze PRIVATE yaze_test_support)
|
||||||
message(STATUS "✓ yaze executable linked to yaze_test_support")
|
message(STATUS "✓ yaze executable linked to yaze_test_support")
|
||||||
else()
|
else()
|
||||||
if(YAZE_BUILD_TESTS)
|
message(WARNING "yaze needs yaze_test_support but TARGET not found")
|
||||||
message(WARNING "yaze needs yaze_test_support but TARGET yaze_test_support not found")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Platform-specific settings
|
# Platform-specific settings
|
||||||
|
|||||||
@@ -26,9 +26,12 @@ if(YAZE_BUILD_EMU AND NOT YAZE_MINIMAL_BUILD)
|
|||||||
absl::failure_signal_handler
|
absl::failure_signal_handler
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link test support if tests are enabled (yaze_editor needs TestManager)
|
# Link test support library (yaze_editor needs TestManager)
|
||||||
if(YAZE_BUILD_TESTS AND TARGET yaze_test_support)
|
if(TARGET yaze_test_support)
|
||||||
target_link_libraries(yaze_emu PRIVATE 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()
|
endif()
|
||||||
|
|
||||||
if(YAZE_ENABLE_UI_TESTS)
|
if(YAZE_ENABLE_UI_TESTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user