Skip to content

Commit

Permalink
(#23361) libpcap: expose the with-snf option for recipes
Browse files Browse the repository at this point in the history
* libpcap: expose the with-snf option for recipes

* Properly handle default option

* Small formatting tweak

* Change defaults

* Denote libsnf as system lib

* Tweak snf check to properly disable when False is selected

* remove auto detection support; requiring explicit snf choice
  • Loading branch information
darakelian authored Apr 30, 2024
1 parent a534717 commit 5c1cde6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/libpcap/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ class LibPcapConan(ConanFile):
"shared": [True, False],
"fPIC": [True, False],
"enable_libusb": [True, False],
"with_snf": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"enable_libusb": False,
"with_snf": False,
}

# TODO: Add dbus-glib when available
Expand Down Expand Up @@ -114,7 +116,9 @@ def generate(self):
"--disable-packet-ring",
"--disable-dbus",
"--disable-rdma",
f"--with-snf={yes_no(self.options.get_safe('with_snf'))}",
])

if cross_building(self):
target_os = "linux" if self.settings.os == "Linux" else "null"
tc.configure_args.append(f"--with-pcap={target_os}")
Expand Down Expand Up @@ -171,3 +175,5 @@ def package_info(self):
self.cpp_info.libs = [f"pcap{suffix}"]
if self.settings.os == "Windows":
self.cpp_info.system_libs = ["ws2_32"]
if self.options.get_safe("with_snf"):
self.cpp_info.system_libs.append("snf")

0 comments on commit 5c1cde6

Please sign in to comment.