windows-amd64-prebuilt-libr.../vcpkg/ports/libpcap/add-disable-packet-option.patch
2020-10-10 14:36:42 +02:00

48 lines
1.8 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fe9979..23783d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,6 +161,7 @@ set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path to dire
option(DISABLE_SNF "Disable Myricom SNF support" OFF)
option(DISABLE_TC "Disable Riverbed TurboCap support" OFF)
+option(DISABLE_PACKET "Disable Packet support" OFF)
#
# Debugging options.
@@ -220,19 +221,21 @@ if(WIN32)
include_directories(${CMAKE_HOME_DIRECTORY}/../../Common)
endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common)
- find_package(Packet)
- if(PACKET_FOUND)
- set(HAVE_PACKET32 TRUE)
- include_directories(${PACKET_INCLUDE_DIRS})
- #
- # Check whether we have the NPcap PacketIsLoopbackAdapter()
- # function.
- #
- cmake_push_check_state()
- set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES})
- check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER)
- cmake_pop_check_state()
- endif(PACKET_FOUND)
+ if(NOT DISABLE_PACKET)
+ find_package(Packet)
+ if(PACKET_FOUND)
+ set(HAVE_PACKET32 TRUE)
+ include_directories(${PACKET_INCLUDE_DIRS})
+ #
+ # Check whether we have the NPcap PacketIsLoopbackAdapter()
+ # function.
+ #
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES})
+ check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER)
+ cmake_pop_check_state()
+ endif(PACKET_FOUND)
+ endif()
message(STATUS "checking for Npcap's version.h")
check_symbol_exists(WINPCAP_PRODUCT_NAME "../../version.h" HAVE_VERSION_H)