Skip to content

Commit

Permalink
Fix ANO linking warning
Browse files Browse the repository at this point in the history
Currently, when building an app that uses the Advanced Network Operator
(ANO), CMake throws some warnings:

```
CMake Warning at operators/advanced_network/CMakeLists.txt:87 (target_link_libraries):
  Target "<target>" requests linking to directory
  "/usr/lib/x86_64-linux-gnu".  Targets may link only to libraries.  CMake is
  dropping the item.
```

Like it says, there are directories being passed into
target_link_libraries with -L which is not supported.

Instead, let's use target_link_directories which is already being used
in the ANO CMakeLists.txt file to pass those DPDK and DOCA directories.

Signed-off-by: John Moon <john.moon@vts-i.com>
  • Loading branch information
JohnMoon-VTS committed Aug 20, 2024
1 parent bc5a48c commit 7383789
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions operators/advanced_network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ target_compile_options(advanced_network_rx PUBLIC ${DPDK_CFLAGS})
target_compile_options(advanced_network_tx PUBLIC ${DPDK_CFLAGS})

target_link_libraries(advanced_network_common PUBLIC holoscan::core)
target_link_libraries(advanced_network_common PUBLIC -L${DPDK_LIBRARY_DIRS} ${DPDK_LIBRARIES} ${DPDK_EXTRA_LIBS})
target_link_libraries(advanced_network_common PUBLIC -L${DOCA_LIBRARY_DIRS} -ldoca_gpunetio libdoca_gpunetio_device.a -ldoca_common -ldoca_argp -ldoca_eth -ldoca_flow)
target_link_directories(advanced_network_common PUBLIC ${DPDK_LIBRARY_DIRS} ${DOCA_LIBRARY_DIRS})
target_link_libraries(advanced_network_common PUBLIC ${DPDK_LIBRARIES} ${DPDK_EXTRA_LIBS} -ldoca_gpunetio libdoca_gpunetio_device.a -ldoca_common -ldoca_argp -ldoca_eth -ldoca_flow)
target_link_libraries(advanced_network_rx PUBLIC advanced_network_common)
target_link_libraries(advanced_network_tx PUBLIC advanced_network_common)

Expand Down

0 comments on commit 7383789

Please sign in to comment.