Skip to content

Conversation

@HTRamsey
Copy link
Collaborator

Summary

  • Add CMake options QGC_ENABLE_BZIP2 and QGC_ENABLE_LZ4 (both default OFF) to optionally include these compression formats
  • These formats are not used by ArduPilot/PX4 firmware or logs, reducing binary size and build complexity when disabled
  • Core formats (gzip, xz, zstd, zip) remain always enabled

Changes

  • Add options to cmake/CustomOptions.cmake
  • Conditionally include bzip2/lz4 CPM packages in src/Utilities/Compression/CMakeLists.txt
  • Configure libarchive with conditional format support
  • Add QGC_ENABLE_BZIP2/QGC_ENABLE_LZ4 compile definitions for C++ code
  • Update unit tests with conditional compilation (#ifdef guards)
  • Fix xz test targets polluting QtCreator by adding BUILD_TESTING OFF

Usage

To enable these optional formats:

cmake -DQGC_ENABLE_BZIP2=ON -DQGC_ENABLE_LZ4=ON ...

Test plan

  • Build with defaults (bzip2/lz4 disabled) - should succeed
  • Build with -DQGC_ENABLE_BZIP2=ON -DQGC_ENABLE_LZ4=ON - should succeed
  • Run unit tests with both configurations
  • Verify bzip2/lz4 test targets no longer appear in QtCreator when disabled

Copilot AI review requested due to automatic review settings January 20, 2026 23:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds CMake options to make BZip2 and LZ4 compression format support optional, reducing binary size and build complexity when these rarely-used formats are not needed in the drone ecosystem.

Changes:

  • Added QGC_ENABLE_BZIP2 and QGC_ENABLE_LZ4 CMake options (both default to OFF)
  • Modified build system to conditionally include BZip2 and LZ4 dependencies and configure libarchive accordingly
  • Updated unit tests with conditional compilation guards to skip BZip2/LZ4 tests when disabled

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cmake/CustomOptions.cmake Adds two new CMake options for optional BZip2 and LZ4 support with clear documentation
src/Utilities/Compression/CMakeLists.txt Conditionally includes BZip2/LZ4 packages, configures libarchive with optional format support, adds compile definitions, and fixes xz test pollution
test/Utilities/Compression/CMakeLists.txt Conditionally includes BZip2/LZ4 test resource files based on enabled options
test/Utilities/Compression/QGCCompressionTest.cc Guards BZip2/LZ4 test cases with preprocessor directives, changes static arrays to vectors for conditional initialization
test/Utilities/Compression/QGCStreamingDecompressionTest.cc Guards BZip2/LZ4 format entries with preprocessor directives in format test list

@HTRamsey HTRamsey force-pushed the feature/optional-compression-formats branch from cdc1a4f to 917925f Compare January 21, 2026 00:26
@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Test Results

linux_gcc_64: 479 passed, 0 skipped

Total: 479 passed, 0 skipped

Code Coverage

Coverage: 100.0%

No baseline available for comparison

Artifact Sizes

Artifact Size
QGroundControl-aarch64.AppImage 187.02 MB
QGroundControl-installer-AMD64-ARM64.exe 74.52 MB
QGroundControl-installer-AMD64.exe 162.40 MB
QGroundControl-installer-ARM64.exe 75.35 MB
QGroundControl-mac.apk 159.48 MB
QGroundControl-windows.apk 159.51 MB
QGroundControl-x86_64.AppImage 174.84 MB
QGroundControl.apk 312.22 MB
QGroundControl.dmg 311.44 MB

No baseline available for comparison

Updated: 2026-01-21 01:58:35 UTC • Triggered by: Android

@HTRamsey HTRamsey force-pushed the feature/optional-compression-formats branch 2 times, most recently from 5139376 to ce8163d Compare January 21, 2026 00:46
Add CMake options QGC_ENABLE_BZIP2 and QGC_ENABLE_LZ4 (both OFF by
default) to control whether these compression formats are built.

Core formats (ZIP, GZIP, XZ/LZMA, ZSTD) remain always enabled.
This reduces binary size and build dependencies for users who don't
need these less common formats.

Also set POSIX_REGEX_LIB=LIBC for libarchive to work around a CMake
bug where ENABLE_LIBGCC=OFF causes a fatal error on Windows MSVC.
@HTRamsey HTRamsey force-pushed the feature/optional-compression-formats branch from ce8163d to d6bb743 Compare January 21, 2026 01:07
@HTRamsey HTRamsey merged commit 5674702 into mavlink:master Jan 21, 2026
17 checks passed
@HTRamsey HTRamsey deleted the feature/optional-compression-formats branch January 21, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant