Skip to content

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

Merged
Dimi1010 merged 6 commits into
seladb:devfrom
Dimi1010:feature/compiled-with-options
May 23, 2026
Merged

Add standardized feature set properties to Pcap++ target.#2136
Dimi1010 merged 6 commits into
seladb:devfrom
Dimi1010:feature/compiled-with-options

Conversation

@Dimi1010

@Dimi1010 Dimi1010 commented May 10, 2026

Copy link
Copy Markdown
Collaborator

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 Outdated

# 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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't think this is necessary. We should only export features which can be included or excluded

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

codecov Bot commented May 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.66%. Comparing base (27f3418) to head (5662224).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2136      +/-   ##
==========================================
- Coverage   82.66%   82.66%   -0.01%     
==========================================
  Files         332      332              
  Lines       59736    59729       -7     
  Branches    12588    12590       +2     
==========================================
- Hits        49379    49373       -6     
- Misses       8953     8965      +12     
+ Partials     1404     1391      -13     
Flag Coverage Δ
23.11.6 7.30% <ø> (-0.04%) ⬇️
24.11.5 7.32% <ø> (ø)
25.11.1 7.32% <ø> (+0.01%) ⬆️
alpine320 76.76% <ø> (ø)
fedora42 76.37% <ø> (+<0.01%) ⬆️
macos-14 82.19% <ø> (ø)
macos-15 82.18% <ø> (ø)
mingw32 71.00% <ø> (+0.01%) ⬆️
mingw64 70.97% <ø> (+0.08%) ⬆️
npcap ?
rhel94 76.16% <ø> (ø)
ubuntu2204 76.19% <ø> (+0.02%) ⬆️
ubuntu2204-icpx 59.25% <ø> (+<0.01%) ⬆️
ubuntu2404 76.48% <ø> (-0.01%) ⬇️
ubuntu2404-arm64 76.45% <ø> (ø)
ubuntu2604 76.37% <ø> (-0.01%) ⬇️
unittest 82.66% <ø> (-0.01%) ⬇️
windows-2022 85.70% <ø> (+0.12%) ⬆️
windows-2025 85.73% <ø> (+0.11%) ⬆️
winpcap 85.73% <ø> (-0.09%) ⬇️
xdp 53.03% <ø> (ø)

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

@seladb seladb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please see one comment, otherwise LGTM

Comment thread Pcap++/CMakeLists.txt Outdated

# 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
Owner

Choose a reason for hiding this comment

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

I don't think this is necessary. We should only export features which can be included or excluded

@Dimi1010 Dimi1010 merged commit 670edea into seladb:dev May 23, 2026
75 of 79 checks passed
@Dimi1010 Dimi1010 deleted the feature/compiled-with-options branch May 23, 2026 09:14
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.

2 participants