[PATCH dwarves 1/2] libbpf: if LIBBPF_EMBEDDED=OFF and libbpf-dev/pkgconfig is not available, fail the build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If using the system library was explicitly requested, ensure it is present
and fail the build if it is not, rather than falling back to the
embedded version (same for pkg-config).

Signed-off-by: Luca Boccassi <bluca@xxxxxxxxxx>
---
 CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 669ea59..0f967d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,9 +4,9 @@ cmake_policy(SET CMP0005 NEW)
 
 option(LIBBPF_EMBEDDED "Use the embedded version of libbpf instead of searching it via pkg-config" ON)
 if (NOT LIBBPF_EMBEDDED)
-	find_package(PkgConfig)
+	find_package(PkgConfig REQUIRED)
 	if(PKGCONFIG_FOUND)
-		pkg_check_modules(LIBBPF libbpf>=0.3.0)
+		pkg_check_modules(LIBBPF REQUIRED libbpf>=0.3.0)
 	endif()
 endif()
 
-- 
2.30.2




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux