Skip to content

Commit

Permalink
Fix bpf linking if specified via LIBBPF_LIBRARIES variable
Browse files Browse the repository at this point in the history
We need to use LIBBPF_LIBRARIES variable instead of just using bpf
for libbpf linking, so it user specified library gets linked in.

Signed-off-by: Jiri Olsa <[email protected]>
  • Loading branch information
olsajiri authored and yonghong-song committed Feb 27, 2020
1 parent 08de253 commit 18da40c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/cc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(LIBBPF_FOUND)
add_executable(test_libbcc_no_libbpf ${TEST_LIBBCC_SOURCES})
add_dependencies(test_libbcc_no_libbpf bcc-shared-no-libbpf)

target_link_libraries(test_libbcc_no_libbpf ${PROJECT_BINARY_DIR}/src/cc/libbcc-no-libbpf.so dl usdt_test_lib bpf)
target_link_libraries(test_libbcc_no_libbpf ${PROJECT_BINARY_DIR}/src/cc/libbcc-no-libbpf.so dl usdt_test_lib ${LIBBPF_LIBRARIES})
set_target_properties(test_libbcc_no_libbpf PROPERTIES INSTALL_RPATH ${PROJECT_BINARY_DIR}/src/cc)
target_compile_definitions(test_libbcc_no_libbpf PRIVATE -DLIBBCC_NAME=\"libbcc-no-libbpf.so\")

Expand Down

0 comments on commit 18da40c

Please sign in to comment.