2020-06-12 14:13:23 +08:00
|
|
|
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/winpcap")
|
|
|
|
message(FATAL_ERROR "FATAL ERROR: winpcap and libpcap are incompatible.")
|
|
|
|
endif()
|
|
|
|
|
2021-09-08 22:45:37 +08:00
|
|
|
vcpkg_from_github(
|
2019-12-21 03:59:02 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-09-08 22:45:37 +08:00
|
|
|
REPO the-tcpdump-group/libpcap
|
2023-10-21 00:55:00 +08:00
|
|
|
REF "libpcap-${VERSION}"
|
2024-10-11 22:47:00 +08:00
|
|
|
SHA512 bb8ba3a589425d71531312285a3c7ded4abdff5ea157b88195e06a2b4f8c93b4db0bca122e9ac853cff14cd16e9519dca30b6bdf0311e7749038fdce57325726
|
2021-09-08 22:45:37 +08:00
|
|
|
HEAD_REF master
|
2024-10-11 22:47:00 +08:00
|
|
|
PATCHES
|
|
|
|
install.diff
|
|
|
|
mingw-dynamic-libname.diff
|
2019-04-29 16:04:27 +08:00
|
|
|
)
|
2019-12-21 03:59:02 +08:00
|
|
|
|
2020-06-12 14:13:23 +08:00
|
|
|
vcpkg_find_acquire_program(BISON)
|
|
|
|
vcpkg_find_acquire_program(FLEX)
|
|
|
|
|
2021-09-08 22:45:37 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" USE_STATIC_RT)
|
|
|
|
|
2024-10-11 22:47:00 +08:00
|
|
|
SET(options "")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_CMAKE_CONFIGURE_OPTIONS MATCHES "Packet_ROOT")
|
|
|
|
list(APPEND options "-DPCAP_TYPE=null")
|
|
|
|
message(STATUS [[Attention:
|
|
|
|
|
|
|
|
This build does not include packet capture capabilities.
|
|
|
|
In order to enable such capabilities, install the Npcap SDK or the WinPcap SDK,
|
|
|
|
and pass '-DPacket_ROOT=<path of SDK>' via VCPKG_CMAKE_CONFIGURE_OPTIONS
|
|
|
|
in a custom triplet file.
|
|
|
|
]])
|
|
|
|
endif()
|
|
|
|
|
2021-09-08 22:45:37 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-10-24 02:20:00 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2019-12-21 03:59:02 +08:00
|
|
|
OPTIONS
|
2024-10-11 22:47:00 +08:00
|
|
|
${options}
|
|
|
|
-DBUILD_WITH_LIBNL=OFF
|
|
|
|
-DDISABLE_AIRPCAP=ON
|
2019-12-21 03:59:02 +08:00
|
|
|
-DDISABLE_BLUETOOTH=ON
|
2024-10-11 22:47:00 +08:00
|
|
|
-DDISABLE_DAG=ON
|
2019-12-21 03:59:02 +08:00
|
|
|
-DDISABLE_DBUS=ON
|
2024-10-11 22:47:00 +08:00
|
|
|
-DDISABLE_DPDK=ON
|
|
|
|
-DDISABLE_NETMAP=ON
|
2019-12-21 03:59:02 +08:00
|
|
|
-DDISABLE_RDMA=ON
|
2020-06-12 14:13:23 +08:00
|
|
|
-DDISABLE_SEPTEL=ON
|
|
|
|
-DDISABLE_SNF=ON
|
|
|
|
-DDISABLE_TC=ON
|
|
|
|
-DENABLE_REMOTE=OFF
|
2024-10-11 22:47:00 +08:00
|
|
|
"-DLEX_EXECUTABLE=${FLEX}"
|
|
|
|
"-DYACC_EXECUTABLE=${BISON}"
|
2021-09-08 22:45:37 +08:00
|
|
|
-DUSE_STATIC_RT=${USE_STATIC_RT}
|
2024-10-11 22:47:00 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
BUILD_WITH_LIBNL # linux only
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_Packet # windows only
|
2019-04-29 16:04:27 +08:00
|
|
|
)
|
|
|
|
|
2021-09-08 22:45:37 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2019-12-21 03:59:02 +08:00
|
|
|
|
2024-10-11 22:47:00 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2021-12-03 11:51:12 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2021-09-08 22:45:37 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2019-04-29 16:04:27 +08:00
|
|
|
endif()
|
2024-10-11 22:47:00 +08:00
|
|
|
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|