Skip to content

Commit 050b928

Browse files
committed
Add libbpf dependency
1 parent 119abac commit 050b928

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

CMake/FindBpf.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
find_path(BPF_INCLUDE_DIR bpf/bpf.h)
2+
find_library(BPF_LIBRARY NAMES bpf)
3+
4+
include(FindPackageHandleStandardArgs)
5+
find_package_handle_standard_args(BPF DEFAULT_MSG BPF_LIBRARY BPF_INCLUDE_DIR)
6+
7+
if(BPF_FOUND)
8+
set(BPF_LIBRARIES ${BPF_LIBRARY})
9+
set(BPF_INCLUDE_DIRS ${BPF_INCLUDE_DIR})
10+
else()
11+
set(BPF_LIBRARIES)
12+
set(BPF_INCLUDE_DIRS)
13+
endif()
14+
15+
mark_as_advanced(BPF_LIBRARIES BPF_INCLUDE_DIRS)

CMake/HPHPFindLibs.cmake

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ include_directories(${LIBEVENT_INCLUDE_DIR})
4444
set(CMAKE_REQUIRED_LIBRARIES "${LIBEVENT_LIB}")
4545
CHECK_FUNCTION_EXISTS("evhttp_bind_socket_with_fd" HAVE_CUSTOM_LIBEVENT)
4646
if(HAVE_CUSTOM_LIBEVENT)
47-
message("Using custom LIBEVENT")
48-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_CUSTOM_LIBEVENT")
47+
message("Using custom LIBEVENT")
48+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_CUSTOM_LIBEVENT")
4949
endif()
5050
set(CMAKE_REQUIRED_LIBRARIES)
5151

@@ -280,6 +280,7 @@ endif()
280280

281281
if (LINUX)
282282
find_package(LibUnwind REQUIRED)
283+
find_package(Bpf REQUIRED)
283284
endif()
284285

285286
# This is required by Homebrew's libc. See
@@ -344,7 +345,7 @@ macro(hphp_link target)
344345
target_link_libraries(${target} ${VISIBILITY} glog)
345346

346347
if (LINUX)
347-
target_link_libraries(${target} ${VISIBILITY} ${LIBUNWIND_LIBRARIES})
348+
target_link_libraries(${target} ${VISIBILITY} ${LIBUNWIND_LIBRARIES} ${BPF_LIBRARIES})
348349
endif()
349350

350351
if (LIBINOTIFY_LIBRARY)
@@ -453,9 +454,9 @@ macro(hphp_link target)
453454

454455
if (ENABLE_XED)
455456
if (LibXed_FOUND)
456-
target_link_libraries(${target} ${VISIBILITY} ${LibXed_LIBRARY})
457+
target_link_libraries(${target} ${VISIBILITY} ${LibXed_LIBRARY})
457458
else()
458-
target_link_libraries(${target} ${VISIBILITY} xed)
459+
target_link_libraries(${target} ${VISIBILITY} xed)
459460
endif()
460461
endif()
461462

ci/ubuntu-24.04-noble/debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Build-Depends:
1919
git,
2020
gperf,
2121
libboost-all-dev,
22+
libbpf-dev,
2223
libbz2-dev,
2324
libc-client-dev,
2425
libc-client2007e-dev,

0 commit comments

Comments
 (0)