Skip to content

Commit

Permalink
Do not require C language to find_package libpcap (seladb#1607)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwixz authored and fxlb committed Oct 22, 2024
1 parent 9789273 commit 414ccdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/modules/FindPCAP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ if(HAVE_PCAP_LIB_VERSION AND NOT CMAKE_CROSSCOMPILING)
# Simple C code to extract the libpcap version
set(PCAP_VERSION_CODE
"
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#include <pcap/pcap.h>
int main() {
Expand All @@ -106,7 +106,7 @@ if(HAVE_PCAP_LIB_VERSION AND NOT CMAKE_CROSSCOMPILING)
")

# Write the code to a temporary file
set(detect_pcap_version_file "${PROJECT_BINARY_DIR}/detect_pcap_version.c")
set(detect_pcap_version_file "${PROJECT_BINARY_DIR}/detect_pcap_version.cpp")
file(WRITE "${detect_pcap_version_file}" "${PCAP_VERSION_CODE}")

# Try to compile and run the program
Expand Down

0 comments on commit 414ccdf

Please sign in to comment.