From 68aed62d20071257f1181ba4205f8c5470ed4188 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 13 Aug 2026 18:15:17 -0400 Subject: [PATCH] fix(Linux): Use Release package build and byte helper Updates CI packaging to configure the tests-disabled consumability build as Release instead of Debug, keeping optimized GCC warnings-as-errors coverage without affecting published artifacts. In profiles.cpp, adds a small append_descriptor_bytes helper (with ) and uses it in gamepad descriptor assembly to reduce repeated vector insert boilerplate. --- .github/workflows/ci.yml | 8 ++++---- src/core/profiles.cpp | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16abf79..4010663 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -501,16 +501,16 @@ jobs: # This intentionally uses a separate BUILD_TESTS=OFF configuration. Test # builds add lizardbyte-common for test support and therefore cannot prove - # that a normal installed package is independently consumable. Debug keeps - # this packaging regression isolated from the open optimized-GCC P2; switch - # this job to Release when that warning is resolved. + # that a normal installed package is independently consumable. Release also + # keeps an optimized GCC library build under warnings-as-errors without + # changing or publishing the ordinary library artifacts. - name: Configure tests-disabled package run: | cmake \ -DBUILD_DOCS=OFF \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TESTS=OFF \ - -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/cmake-build-package/install" \ -DLIBVIRTUALHID_BUILD_TOOLS=OFF \ -DLIBVIRTUALHID_ENABLE_PACKAGING=OFF \ diff --git a/src/core/profiles.cpp b/src/core/profiles.cpp index 20c752f..598da10 100644 --- a/src/core/profiles.cpp +++ b/src/core/profiles.cpp @@ -6,6 +6,7 @@ // standard includes #include #include +#include #include #include #include @@ -90,6 +91,16 @@ namespace lvh::profiles { return descriptor; } + void append_descriptor_bytes( + std::vector &descriptor, + std::initializer_list bytes + ) { + descriptor.reserve(descriptor.size() + bytes.size()); + for (const auto byte : bytes) { + descriptor.push_back(byte); + } + } + void append_common_gamepad_buttons(std::vector &descriptor, bool include_misc_button) { descriptor.insert( descriptor.end(), @@ -270,8 +281,8 @@ namespace lvh::profiles { report_id, // Report ID }; append_common_gamepad_buttons(descriptor, false); - descriptor.insert( - descriptor.end(), + append_descriptor_bytes( + descriptor, { 0x05, 0x01, // Usage Page (Generic Desktop) @@ -325,8 +336,8 @@ namespace lvh::profiles { ); if (supports_rumble) { - descriptor.insert( - descriptor.end(), + append_descriptor_bytes( + descriptor, { 0x06, 0x00,