Files
yaze/tools/test_helpers/CMakeLists.txt
scawful 6db7ba4782 chore: consolidate gRPC and protobuf linking into a dedicated support library
- Introduced a new `yaze_grpc_support` library to centralize all gRPC and protobuf usage, addressing Windows linker errors and improving build stability.
- Updated CMake configurations across various components to link against the new support library instead of individual protobuf targets, simplifying the linking process.
- Removed legacy whole-archive linking logic, ensuring a cleaner and more maintainable build setup.

Benefits:
- Reduces complexity in CMake files and enhances compatibility across platforms.
- Prevents potential linker errors by consolidating gRPC and protobuf dependencies into a single library.
2025-10-18 15:58:58 -04:00

67 lines
1.5 KiB
CMake

# Add golden data extractor tool
add_executable(overworld_golden_data_extractor
overworld_golden_data_extractor.cc
)
target_link_libraries(overworld_golden_data_extractor PRIVATE
yaze_core
${CMAKE_THREAD_LIBS_INIT}
)
# Add vanilla values extractor tool
add_executable(extract_vanilla_values
extract_vanilla_values.cc
)
target_link_libraries(extract_vanilla_values PRIVATE
yaze_core
${CMAKE_THREAD_LIBS_INIT}
)
# Add rom_patch_utility tool
add_executable(rom_patch_utility
rom_patch_utility.cc
)
target_link_libraries(rom_patch_utility PRIVATE
yaze_core
${CMAKE_THREAD_LIBS_INIT}
)
# Add dungeon_test_harness tool
add_executable(dungeon_test_harness
dungeon_test_harness.cc
)
target_link_libraries(dungeon_test_harness PRIVATE
yaze_core
${CMAKE_THREAD_LIBS_INIT}
)
# Windows stack size configuration for helper tools
set(HELPER_TOOLS
overworld_golden_data_extractor
extract_vanilla_values
rom_patch_utility
dungeon_test_harness
)
foreach(TOOL ${HELPER_TOOLS})
# gRPC/protobuf linking is now handled by yaze_grpc_support library
if(WIN32)
if(MSVC)
target_link_options(${TOOL} PRIVATE /STACK:16777216)
elseif(MINGW OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_options(${TOOL} PRIVATE -Wl,--stack,16777216)
else()
target_link_options(${TOOL} PRIVATE -Wl,--stack,16777216)
endif()
endif()
endforeach()
# Install tools to bin directory
install(TARGETS overworld_golden_data_extractor extract_vanilla_values rom_patch_utility dungeon_test_harness
DESTINATION bin
)