From 8b5429d84e5dec704ec49b8b600ee27b3b789cea Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 14 Oct 2025 12:23:23 -0400 Subject: [PATCH] refactor(ci): enable EMU, Z3ED, and tools builds in CI and release workflows - Updated CI and release workflows to enable building the emulator (YAZE_BUILD_EMU), Z3ED (YAZE_BUILD_Z3ED), and additional tools (YAZE_BUILD_TOOLS). - Ensured consistent build configurations across different platforms to enhance testing and deployment capabilities. Benefits: - Improves the completeness of builds in CI and release processes, facilitating better testing and integration of all components. --- .github/workflows/ci.yml | 16 +++++++++++----- .github/workflows/release.yml | 11 +++++++++-- cmake/asar.cmake | 7 ++++++- src/app/core/core_library.cmake | 13 +++---------- src/app/net/net_library.cmake | 8 +------- src/cli/agent.cmake | 8 +------- src/cli/z3ed.cmake | 12 +++--------- test/CMakeLists.txt | 6 +----- 8 files changed, 35 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d909951..b8ce2d6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -397,8 +397,10 @@ jobs: -DOPENSSL_NO_ASM=ON ` -DCMAKE_CXX_FLAGS="/Dgoogle_protobuf_undef_DWORD=1 /D__PRFCHWINTRIN_H" ` -DYAZE_BUILD_TESTS=ON ` - -DYAZE_BUILD_EMU=OFF ` - -DYAZE_ENABLE_ROM_TESTS=OFF 2>&1 | Tee-Object -FilePath cmake_config.log + -DYAZE_BUILD_EMU=ON ` + -DYAZE_ENABLE_ROM_TESTS=OFF ` + -DYAZE_BUILD_Z3ED=ON ` + -DYAZE_BUILD_TOOLS=ON 2>&1 | Tee-Object -FilePath cmake_config.log # Note: Full-featured build to match release configuration # Note: YAZE_BUILD_EMU=OFF disables standalone emulator executable # but yaze_emulator library is still built for main app/tests @@ -424,8 +426,10 @@ jobs: -DCMAKE_C_COMPILER=${{ matrix.cc }} \ -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \ -DYAZE_BUILD_TESTS=ON \ - -DYAZE_BUILD_EMU=OFF \ + -DYAZE_BUILD_EMU=ON \ -DYAZE_ENABLE_ROM_TESTS=OFF \ + -DYAZE_BUILD_Z3ED=ON \ + -DYAZE_BUILD_TOOLS=ON \ -DNFD_PORTAL=ON 2>&1 | tee cmake_config.log else # macOS: Use default GTK backend @@ -434,8 +438,10 @@ jobs: -DCMAKE_C_COMPILER=${{ matrix.cc }} \ -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \ -DYAZE_BUILD_TESTS=ON \ - -DYAZE_BUILD_EMU=OFF \ - -DYAZE_ENABLE_ROM_TESTS=OFF 2>&1 | tee cmake_config.log + -DYAZE_BUILD_EMU=ON \ + -DYAZE_ENABLE_ROM_TESTS=OFF \ + -DYAZE_BUILD_Z3ED=ON \ + -DYAZE_BUILD_TOOLS=ON 2>&1 | tee cmake_config.log fi echo "::endgroup::" # Note: Full-featured build to match release configuration diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6a91f8d..fff9fd09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -406,6 +406,9 @@ jobs: -DOPENSSL_NO_ASM=ON ` -DCMAKE_CXX_FLAGS="/Dgoogle_protobuf_undef_DWORD=1 /D__PRFCHWINTRIN_H" ` -DYAZE_BUILD_TESTS=ON ` + -DYAZE_BUILD_EMU=ON ` + -DYAZE_BUILD_Z3ED=ON ` + -DYAZE_BUILD_TOOLS=ON ` -DYAZE_ENABLE_ROM_TESTS=OFF 2>&1 | Tee-Object -FilePath cmake_config.log # Note: Tests enabled for pre-1.0 releases to catch issues before publishing # ROM tests disabled (require test ROM file) @@ -427,8 +430,10 @@ jobs: cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_OSX_ARCHITECTURES=${{ matrix.mac_arch }} \ - -DYAZE_BUILD_EMU=OFF \ -DYAZE_BUILD_TESTS=ON \ + -DYAZE_BUILD_EMU=ON \ + -DYAZE_BUILD_Z3ED=ON \ + -DYAZE_BUILD_TOOLS=ON \ -DYAZE_ENABLE_ROM_TESTS=OFF 2>&1 | tee cmake_config.log echo "::endgroup::" # Note: YAZE_BUILD_EMU=OFF disables standalone emulator executable @@ -444,8 +449,10 @@ jobs: echo "::group::CMake Configuration (Linux)" cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DYAZE_BUILD_EMU=OFF \ -DYAZE_BUILD_TESTS=ON \ + -DYAZE_BUILD_EMU=ON \ + -DYAZE_BUILD_Z3ED=ON \ + -DYAZE_BUILD_TOOLS=ON \ -DYAZE_ENABLE_ROM_TESTS=OFF \ -DNFD_PORTAL=ON 2>&1 | tee cmake_config.log echo "::endgroup::" diff --git a/cmake/asar.cmake b/cmake/asar.cmake index 6a3ebcfe..0946a1d9 100644 --- a/cmake/asar.cmake +++ b/cmake/asar.cmake @@ -8,6 +8,11 @@ set(ASAR_GEN_LIB ON CACHE BOOL "Build Asar static library") set(ASAR_GEN_EXE_TEST OFF CACHE BOOL "Build Asar executable tests") set(ASAR_GEN_DLL_TEST OFF CACHE BOOL "Build Asar DLL tests") +# Force Asar to use static MSVC runtime to match vcpkg static triplets +if(MSVC) + set(MSVC_LIB_TYPE T CACHE STRING "Asar MSVC runtime type" FORCE) +endif() + # Set Asar source directory set(ASAR_SRC_DIR "${CMAKE_SOURCE_DIR}/src/lib/asar/src") @@ -91,4 +96,4 @@ function(yaze_create_asar_patch_tool tool_name patch_file rom_file) COMMENT "Applying Asar patch ${patch_file} to ${rom_file}" ) endif() -endfunction() \ No newline at end of file +endfunction() diff --git a/src/app/core/core_library.cmake b/src/app/core/core_library.cmake index 9054705c..9dac977f 100644 --- a/src/app/core/core_library.cmake +++ b/src/app/core/core_library.cmake @@ -147,18 +147,11 @@ if(YAZE_WITH_GRPC) ) if(YAZE_PROTOBUF_TARGET) target_link_libraries(yaze_core_lib PUBLIC ${YAZE_PROTOBUF_TARGET}) + if(MSVC) + target_link_options(yaze_core_lib PUBLIC /WHOLEARCHIVE:$) + endif() endif() - # On Windows, force whole-archive linking for protobuf to ensure all symbols are included -if(MSVC AND YAZE_PROTOBUF_TARGET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_link_options(yaze_core_lib PUBLIC - /WHOLEARCHIVE:$) - else() - message(STATUS "○ Skipping /WHOLEARCHIVE for libprotobuf in yaze_core_lib (clang-cl)") - endif() -endif() - message(STATUS " - gRPC test harness + ROM service enabled") endif() diff --git a/src/app/net/net_library.cmake b/src/app/net/net_library.cmake index 67740ad3..5af2c1b8 100644 --- a/src/app/net/net_library.cmake +++ b/src/app/net/net_library.cmake @@ -86,14 +86,8 @@ if(YAZE_WITH_GRPC) ) if(YAZE_PROTOBUF_TARGET) target_link_libraries(yaze_net PUBLIC ${YAZE_PROTOBUF_TARGET}) - endif() - - # On Windows, force whole-archive linking for protobuf to ensure all symbols are included - if(MSVC AND YAZE_PROTOBUF_TARGET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(MSVC) target_link_options(yaze_net PUBLIC /WHOLEARCHIVE:$) - else() - message(STATUS "○ Skipping /WHOLEARCHIVE for libprotobuf in yaze_net (clang-cl)") endif() endif() diff --git a/src/cli/agent.cmake b/src/cli/agent.cmake index d828b8be..139c95eb 100644 --- a/src/cli/agent.cmake +++ b/src/cli/agent.cmake @@ -163,14 +163,8 @@ if(YAZE_WITH_GRPC) ) if(YAZE_PROTOBUF_TARGET) target_link_libraries(yaze_agent PUBLIC ${YAZE_PROTOBUF_TARGET}) - endif() - - # On Windows, force whole-archive linking for protobuf to ensure all symbols are included - if(MSVC AND YAZE_PROTOBUF_TARGET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(MSVC) target_link_options(yaze_agent PUBLIC /WHOLEARCHIVE:$) - else() - message(STATUS "○ Skipping /WHOLEARCHIVE for libprotobuf (clang-cl)") endif() endif() diff --git a/src/cli/z3ed.cmake b/src/cli/z3ed.cmake index 21063acb..fb3a30ae 100644 --- a/src/cli/z3ed.cmake +++ b/src/cli/z3ed.cmake @@ -42,14 +42,8 @@ if(YAZE_WITH_GRPC) target_link_libraries(z3ed PRIVATE grpc++ grpc++_reflection) if(YAZE_PROTOBUF_TARGET) target_link_libraries(z3ed PRIVATE ${YAZE_PROTOBUF_TARGET}) - endif() - - # On Windows, force whole-archive linking for protobuf to ensure all symbols are included -if(MSVC AND YAZE_PROTOBUF_TARGET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_link_options(z3ed PRIVATE /WHOLEARCHIVE:$) - else() - message(STATUS "○ Skipping /WHOLEARCHIVE for libprotobuf in z3ed (clang-cl)") + if(MSVC) + target_link_options(z3ed PRIVATE /WHOLEARCHIVE:$) + endif() endif() endif() -endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2aa5a741..e982ef36 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -49,11 +49,7 @@ if(YAZE_BUILD_TESTS) target_link_options(${suite_name} PRIVATE /STACK:16777216) # Force whole-archive linking for protobuf to ensure all symbols are included if(YAZE_WITH_GRPC AND YAZE_PROTOBUF_TARGET) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_link_options(${suite_name} PRIVATE /WHOLEARCHIVE:$) - else() - message(STATUS "○ Skipping /WHOLEARCHIVE for libprotobuf in ${suite_name} (clang-cl)") - endif() + target_link_options(${suite_name} PRIVATE /WHOLEARCHIVE:$) endif() else() target_link_options(${suite_name} PRIVATE -Wl,--stack,16777216)