forked from seladb/PcapPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed seladb#1635 xsk.h should be taken from libxdp
- Loading branch information
Showing
4 changed files
with
40 additions
and
1 deletion.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ~~~ | ||
# - Try to find libxdp | ||
# | ||
# Once done this will define | ||
# | ||
# XDP_FOUND - System has libxdp | ||
# XDP_INCLUDE_DIRS - The libxdp include directories | ||
# XDP_LIBRARIES - The libraries needed to use libxdp | ||
# ~~~ | ||
|
||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(PC_LIBBPF libxdp) | ||
|
||
find_path( | ||
XDP_INCLUDE_DIRS | ||
NAMES xdp/xsk.h | ||
HINTS ${PC_LIBXDP_INCLUDE_DIRS}) | ||
|
||
find_library( | ||
XDP | ||
NAMES xdp | ||
HINTS ${PC_LIBXDP_LIBRARY_DIRS}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
XDP | ||
REQUIRED_VARS XDP XDP_INCLUDE_DIRS | ||
VERSION_VAR XDP_VERSION | ||
FAIL_MESSAGE "libxdp not found!") | ||
|
||
if(XDP_FOUND AND NOT TARGET XDP::XDP) | ||
add_library(XDP::XDP INTERFACE IMPORTED) | ||
set_target_properties(XDP::XDP PROPERTIES INTERFACE_LINK_LIBRARIES "${XDP_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${XDP_INCLUDE_DIRS}") | ||
endif() |