Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require C language to find_package libpcap #1607

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading