libbpf: if LIBBPF_EMBEDDED=OFF and libbpf-dev/pkgconfig is not available, fail the build
PATCH 1/2 libbpf: if LIBBPF_EMBEDDED=OFF and libbpf-dev/pkgconfig is not available, fail the build
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 <[email protected]>
--- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
CMakeLists.txt +2 -2
@@ -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()
Signature · 1 line
2.30.2
PATCH 2/2 libbpf: bump dependency to >= 0.4.0
Required for the new API btf__add_float()
Signed-off-by Luca Boccassi <[email protected]>
--- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
CMakeLists.txt +1 -1
@@ -6,7 +6,7 @@ option(LIBBPF_EMBEDDED "Use the embedded version of libbpf instead of searching if (NOT LIBBPF_EMBEDDED) find_package(PkgConfig REQUIRED) if(PKGCONFIG_FOUND) - pkg_check_modules(LIBBPF REQUIRED libbpf>=0.3.0) + pkg_check_modules(LIBBPF REQUIRED libbpf>=0.4.0) endif() endif()
Signature · 1 line
2.30.2
Em Sun, Jun 13, 2021 at 02:47:05PM +0100, Luca Boccassi escreveu:
Quoted 3 lines
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).
Thanks, applied and tested both patches,
- Arnaldo
Quoted 24 lines
Signed-off-by Luca Boccassi <[email protected]>--- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)CMakeLists.txt +2
-2@@ -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()Signature · 1 line
2.30.2
Signature · 1 line
- Arnaldo