Skip to content

Add standardized feature set properties to Pcap++ target.#2136

Open
Dimi1010 wants to merge 3 commits intoseladb:devfrom
Dimi1010:feature/compiled-with-options
Open

Add standardized feature set properties to Pcap++ target.#2136
Dimi1010 wants to merge 3 commits intoseladb:devfrom
Dimi1010:feature/compiled-with-options

Conversation

@Dimi1010
Copy link
Copy Markdown
Collaborator

@Dimi1010 Dimi1010 commented May 10, 2026

Implements #2129

The feature set options follow the pattern PCPP_HAS_XXX_SUPPORT, with XXX being the target feature set. Currently if a feature set is active the cmake Pcap++ target will have a property with the corresponding name set to a truthy value and a corresponding compile time definition will be added to the compilation. Otherwise the target will have a false value on the property and no compile definition will be added to the compilation.

This should allow consumers of the library to query the target at for features both at configure time and compile time.

The feature set options follow the pattern `PCPP_HAS_XXX_SUPPORT`, with XXX being the target feature set.
Currently if a feature set is active the cmake Pcap++ target will have a property with the corresponding name set to a truthy value
and a corresponding compile time definition will be added to the compilation.

This should allow consumers of the library to query the target at for features both at configure time and compile time.
Comment thread Pcap++/CMakeLists.txt

# Pcap++ Feature sets:
# - PCPP_HAS_PCAPNG_ZSTD_SUPPORT - Whether Pcap++ was built with support for zstd-compressed pcapng files using the light_pcapng library
# - PCPP_HAS_PCAP_FILE_SUPPORT - Whether Pcap++ was built with support for reading/writing pcap files (Pcap++ always has pcap file support)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PCPP_HAS_PCAP_FILE_SUPPORT is for symmetry with PCPP_HAS_PCAP_LIVE_SUPPORT and PCPP_HAS_PCAP_REMOTE_SUPPORT.

@Dimi1010 Dimi1010 linked an issue May 10, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.65%. Comparing base (aed8e5a) to head (ae8fc85).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2136      +/-   ##
==========================================
- Coverage   82.66%   82.65%   -0.01%     
==========================================
  Files         332      332              
  Lines       59706    59699       -7     
  Branches    12384    12591     +207     
==========================================
- Hits        49353    49347       -6     
- Misses       8952     8963      +11     
+ Partials     1401     1389      -12     
Flag Coverage Δ
23.11.6 7.29% <ø> (-0.01%) ⬇️
24.11.5 7.30% <ø> (-0.02%) ⬇️
25.11.1 7.30% <ø> (-0.04%) ⬇️
alpine320 76.79% <ø> (ø)
fedora42 76.40% <ø> (+0.02%) ⬆️
macos-14 82.18% <ø> (ø)
macos-15 82.17% <ø> (ø)
mingw32 71.00% <ø> (+0.01%) ⬆️
mingw64 70.96% <ø> (+0.08%) ⬆️
npcap ?
rhel94 76.19% <ø> (-0.01%) ⬇️
ubuntu2204 76.20% <ø> (+<0.01%) ⬆️
ubuntu2204-icpx 59.25% <ø> (ø)
ubuntu2404 76.51% <ø> (+0.02%) ⬆️
ubuntu2404-arm64 76.48% <ø> (ø)
ubuntu2604 76.41% <ø> (-0.03%) ⬇️
unittest 82.65% <ø> (-0.01%) ⬇️
windows-2022 85.69% <ø> (+0.10%) ⬆️
windows-2025 85.73% <ø> (+0.11%) ⬆️
winpcap 85.73% <ø> (-0.08%) ⬇️
xdp 53.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dimi1010 Dimi1010 marked this pull request as ready for review May 10, 2026 14:34
@Dimi1010 Dimi1010 requested a review from seladb as a code owner May 10, 2026 14:34
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.

Provide compile time feature availability querying capability.

1 participant