vcpkg/ports/libpcap/add-disable-packet-option.patch
Silvio Traversaro 310f4df34f
[libpcap] Enable compilation of libpcap port on x86-windows and x64-windows (#10731)
* Enable compilation of libpcap port on x86-windows and x64-windows

As winpcap and libpcap install the same headers, this two
port have been marked as not not compatible, and cannot be
installed together.

* Update ci.baseline.txt

* Add libcrafter failing ports to ci.baseline.txt
2020-06-11 23:13:23 -07: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)