-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
PcapPlusPlus: enhance platform support and fix missing syslink on Windows #5419
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
259c0d4
Add test to detect missing iphlpapi linkage on Windows
Doekin 76c8177
Add the required iphlpapi linkage for Windows
Doekin 1f1db3d
Add support for Mingw
Doekin 708eeb9
Simplify platform check
Doekin de66012
Add MacOS, Android and BSD
Doekin fce7531
Add frameworks for MacOS
Doekin d4daedc
accurate MacOS framework
Doekin 4ed60a6
Fix complie issue on BSD caused by VLA usage
Doekin e9d78bc
Fix patch file name
Doekin 4000cab
Add pthread syslink for Linux and BSD platforms
Doekin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,18 +13,18 @@ package("pcapplusplus") | |
|
||
add_links("Pcap++", "Packet++", "Common++") | ||
|
||
if is_plat("windows") then | ||
add_syslinks("ws2_32") | ||
if is_plat("windows") or is_plat("mingw") then | ||
add_syslinks("ws2_32", "iphlpapi") | ||
end | ||
|
||
add_deps("cmake") | ||
if is_plat("windows") then | ||
if is_plat("windows") or is_plat("mingw") then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. |
||
add_deps("npcap_sdk") | ||
elseif is_plat("linux") then | ||
add_deps("libpcap") | ||
end | ||
|
||
on_install("windows", "linux", function (package) | ||
on_install("windows", "mingw", "linux", function (package) | ||
local configs = { | ||
"-DPCAPPP_BUILD_EXAMPLES=OFF", | ||
"-DPCAPPP_BUILD_TESTS=OFF", | ||
|
@@ -35,11 +35,19 @@ package("pcapplusplus") | |
|
||
on_test(function (package) | ||
assert(package:check_cxxsnippets({test = [[ | ||
#include <vector> | ||
#include "pcapplusplus/IPv4Layer.h" | ||
#include "pcapplusplus/Packet.h" | ||
#include "pcapplusplus/PcapFileDevice.h" | ||
void test() { | ||
#include "pcapplusplus/PcapLiveDeviceList.h" | ||
|
||
void testPcapFileReaderDevice() { | ||
pcpp::PcapFileReaderDevice reader("1_packet.pcap"); | ||
} | ||
|
||
void testPcapLiveDeviceList() { | ||
std::vector<pcpp::PcapLiveDevice *> devList = | ||
pcpp::PcapLiveDeviceList::getInstance().getPcapLiveDevicesList(); | ||
} | ||
]]}, {configs = {languages = "c++17"}})) | ||
end) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if is_plat("windows", "mingw") then