Add standardized feature set properties to Pcap++ target.#2136
Conversation
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.
|
|
||
| # 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) |
There was a problem hiding this comment.
PCPP_HAS_PCAP_FILE_SUPPORT is for symmetry with PCPP_HAS_PCAP_LIVE_SUPPORT and PCPP_HAS_PCAP_REMOTE_SUPPORT.
There was a problem hiding this comment.
I don't think this is necessary. We should only export features which can be included or excluded
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
seladb
left a comment
There was a problem hiding this comment.
Please see one comment, otherwise LGTM
|
|
||
| # 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) |
There was a problem hiding this comment.
I don't think this is necessary. We should only export features which can be included or excluded
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.