Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pcapplusplus with zstd #5579

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

jj683
Copy link
Contributor

@jj683 jj683 commented Oct 25, 2024

@jj683
Copy link
Contributor Author

jj683 commented Oct 25, 2024

/home/runner/.xmake/cache/packages/2410/p/pcapplusplus/v24.09/source/3rdParty/json/include/json.hpp:24356:35: error: identifier '_json' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
 24356 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
       |                       ~~~~~~~~~~~~^~~~~
       |                       operator""_json

The problem is that the 3rd party json library that PcapPlusPlus use has a deprecated literal operator in it, which causes a warning (and error as the result of -Werror) in modern versions of clang.
I have created a PR to update the json library version (which fixes this problem):
seladb/PcapPlusPlus#1623
But it will take months for the new release.

How should we proceed in such a case? The extra flag with zstd (disabled by default) does not affect the build in any way.

@waruqi
Copy link
Member

waruqi commented Oct 25, 2024

use io.replace or add_patches to patch and remove -Werror

@star-hengxing
Copy link
Contributor

-Werror or -WX cannot be unconditionally enabled, package management must remove these flags.

@star-hengxing
Copy link
Contributor

star-hengxing commented Oct 25, 2024

However, a better way for this library would be to patch cmake to remove the bundle dependencies.
If you're interested, consider using find_package or pkgconfig + import target.

if is_subhost("windows") then 
     add_deps("pkgconf") 
else 
     add_deps("pkg-config") 
end
add_deps("curlpp")
pkg_search_module(curlpp REQUIRED IMPORTED_TARGET curlpp)
target_link_libraries(xxx PkgConfig::curlpp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants