Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Officeyutong committed Jun 7, 2023
1 parent 463ab3c commit 6785ff8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/wasm_bpf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function(AddLibbpfAsExternal SOURCE_ROOT WITH_PKG_CONF)

if(${WITH_PKG_CONF})
set(PKGCONF_PREFIX "")
set(LIBBPF_DEP_LIBRARIES "z" "elf" PARENT_SCOPE)
set(LIBBPF_DEP_LIBRARIES "elf" "z" PARENT_SCOPE)
else()
set(PKGCONF_PREFIX "NO_PKG_CONFIG=1")
endif()
Expand Down Expand Up @@ -113,6 +113,15 @@ if(NOT ${LIBBPF_FOUND})
message(FATAL_ERROR "Could not find libbpf")
endif()

if(${WASMEDGE_PLUGIN_WASM_BPF_BUILD_LIBBPF_WITH_PKG_CONF})
# Find the dependencies `libelf` and `libz` of libbpf
find_package(PkgConfig)

pkg_check_modules(LIBBPF_DEP REQUIRED libelf zlib)

message(STATUS "(From PKGCONF) LIBBPF_DEP_LIBRARIES=${LIBBPF_DEP_LIBRARIES}")
endif()

message(STATUS "LIBBPF_INCLUDE_DIRS=${LIBBPF_INCLUDE_DIRS}")
message(STATUS "LIBBPF_LIBRARIES=${LIBBPF_LIBRARIES}")
message(STATUS "LIBBPF_TARGET_NAME=${LIBBPF_TARGET_NAME}")
Expand All @@ -121,15 +130,6 @@ message(STATUS "LIBBPF_SOURCE=${LIBBPF_SOURCE}")
message(STATUS "LIBBPF_DEP_LIBRARIES=${LIBBPF_DEP_LIBRARIES}")
message(STATUS "LIBBPF_DEP_LIBRARIES_STATIC=${LIBBPF_DEP_LIBRARIES_STATIC}")

if(WASMEDGE_PLUGIN_WASM_BPF_BUILD_LIBBPF_WITH_PKG_CONF)
# Find the dependencies `libelf` and `libz` of libbpf
find_package(PkgConfig)

pkg_check_modules(LIBBPF_DEP REQUIRED libelf zlib)

message(DEBUG "LIBBPF_DEP_LIBRARIES=${LIBBPF_DEP_LIBRARIES}")
endif()

wasmedge_add_library(wasmedgePluginWasmBpf
SHARED
wasm-bpf-module.cpp
Expand Down

0 comments on commit 6785ff8

Please sign in to comment.