diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 018d64045..0370ce54c 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -53,6 +53,7 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive + fetch-depth: 0 # Ensures all tags are fetched - name: 🔧 Prepare shell: bash @@ -85,9 +86,11 @@ jobs: -e LANG="C.UTF-8" \ -e LC_ALL="C.UTF-8" \ ghcr.io/hyperion-project/debian:${{ env.DOCKER_TAG }} \ - /bin/bash -c "cmake --preset linux-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }} -DPLATFORM=${{ matrix.os.platform }} ${{ env.CPACK_SYSTEM_PROCESSOR }} && - cmake --build --preset linux-${{ env.BUILD_TYPE }} --target package && - cp /source/build/Hyperion-* /deploy/ 2>/dev/null" + /bin/bash -c " + git config --global --add safe.directory /source && + cmake --preset linux-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }} -DPLATFORM=${{ matrix.os.platform }} ${{ env.CPACK_SYSTEM_PROCESSOR }} && + cmake --build --preset linux-${{ env.BUILD_TYPE }} --target package && + cp /source/build/Hyperion-* /deploy/ 2>/dev/null" env: DOCKER_TAG: ${{ inputs.codename == 'bullseye' && matrix.os.architecture[0] == 'armv6' && inputs.codename || format('{0}-qt6', inputs.codename) }} BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 76142ff8d..0813ea7dc 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -42,7 +42,8 @@ jobs: - name: ⬇ Checkout uses: actions/checkout@v5 with: - submodules: recursive + submodules: recursive + fetch-depth: 0 # Ensures all tags are fetched - name: 🔧 Prepare shell: bash diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7f1569af4..2cfb87de5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -43,6 +43,7 @@ jobs: uses: actions/checkout@v5 with: submodules: recursive + fetch-depth: 0 # Ensures all tags are fetched - name: 🔧 Prepare shell: bash diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 5da6d4773..48e59ff20 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -424,6 +424,10 @@ if(ENABLE_PROTOBUF_SERVER) endif() if(NOT USE_SYSTEM_PROTO_LIBS) + + # Enable ProtoBuf verbose mode + set(protobuf_VERBOSE OFF CACHE BOOL "Build protobuf verbose") + # Build Protobuf as static library set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Build protobuf shared") @@ -433,8 +437,11 @@ if(ENABLE_PROTOBUF_SERVER) # Disable build of Protobuf with zlib support set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build protobuf with zlib support") - # Disable build of libupb - set(protobuf_BUILD_LIBUPB OFF CACHE BOOL "Build libupb") + # Enable build of libupb + set(protobuf_BUILD_LIBUPB ON CACHE BOOL "Build libupb") + + # Force all dependencies to be downloaded from GitHub + set(protobuf_FORCE_FETCH_DEPENDENCIES ON CACHE INTERNAL "Force all dependencies to be downloaded from GitHub") # Build abeil (3rd party sub-module) with C++ version requirements set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Build abseil-cpp with C++ version requirements propagated") @@ -458,8 +465,15 @@ if(ENABLE_PROTOBUF_SERVER) set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build protobuf libraries and protoc compiler") endif() + include(FetchContent) + # Add Protobuf directory to the build - add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/external/protobuf") + FetchContent_Declare( + protobuf + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/protobuf" + PATCH_COMMAND git apply "${CMAKE_CURRENT_SOURCE_DIR}/patch/protobuf/atomic.diff" + ) + FetchContent_MakeAvailable(protobuf) if(CMAKE_CROSSCOMPILING) if(IMPORT_PROTOC) @@ -472,6 +486,7 @@ if(ENABLE_PROTOBUF_SERVER) PREFIX ${CMAKE_BINARY_DIR}/dependencies/external/protoc-host BUILD_ALWAYS OFF DOWNLOAD_COMMAND "" + PATCH_COMMAND git apply "${CMAKE_CURRENT_SOURCE_DIR}/patch/protobuf/atomic.diff" INSTALL_COMMAND "" SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/protobuf CMAKE_ARGS -Dprotobuf_BUILD_LIBPROTOC:BOOL=OFF diff --git a/dependencies/external/protobuf b/dependencies/external/protobuf index 1be1c9d0e..a79f2d2e9 160000 --- a/dependencies/external/protobuf +++ b/dependencies/external/protobuf @@ -1 +1 @@ -Subproject commit 1be1c9d0ea6efa2a25bd7b76186844d1669be78a +Subproject commit a79f2d2e9fadd75e94f3fe40a0399bf0a5d90551 diff --git a/dependencies/patch/protobuf/atomic.diff b/dependencies/patch/protobuf/atomic.diff new file mode 100644 index 000000000..521d1da0a --- /dev/null +++ b/dependencies/patch/protobuf/atomic.diff @@ -0,0 +1,15 @@ +diff --git a/cmake/protobuf-configure-target.cmake b/cmake/protobuf-configure-target.cmake +index c67c57056..171e0a8f0 100644 +--- a/cmake/protobuf-configure-target.cmake ++++ b/cmake/protobuf-configure-target.cmake +@@ -7,8 +7,8 @@ + + # Refactors configuration options set on all Protobuf targets + function(protobuf_configure_target target) +- if(protobuf_LINK_LIBATOMIC) +- target_link_libraries(libprotobuf PRIVATE atomic) ++ if(protobuf_LINK_LIBATOMIC AND "${target}" STREQUAL "libprotobuf") ++ target_link_libraries("${target}" PRIVATE atomic) + endif() + + target_compile_features("${target}" PUBLIC cxx_std_17)