summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-08-25 11:33:29 +0200
committerDamjan Marion <damarion@cisco.com>2018-08-25 11:56:03 +0200
commit74449b8b68801e0938f528f19d69e75644cb2ee9 (patch)
treee3ba6294196c478d1a53c296043fb3ca58c6ee9c /src/plugins/dpdk
parent2bfdda76d8b1cffcd8e30ca6855f293b1b1953c5 (diff)
cmake: improve add_vpp_plugin macro
Change-Id: Iffd5c45ab242a919592a1f686f7f880936b68a1a Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk')
-rw-r--r--src/plugins/dpdk/CMakeLists.txt34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/plugins/dpdk/CMakeLists.txt b/src/plugins/dpdk/CMakeLists.txt
index 66407041eae..0b08b0663b6 100644
--- a/src/plugins/dpdk/CMakeLists.txt
+++ b/src/plugins/dpdk/CMakeLists.txt
@@ -81,7 +81,17 @@ endif()
##############################################################################
if(DPDK_INCLUDE_DIR AND DPDK_LIB)
include_directories (${DPDK_INCLUDE_DIR})
- add_vpp_plugin(dpdk_plugin
+
+ message(STATUS "Found DPDK ${DPDK_VERSION} in ${DPDK_INCLUDE_DIR}")
+ get_filename_component(DPDK_LIB_DIR ${DPDK_LIB} DIRECTORY)
+ set(DPDK_LINK_FLAGS "-L${DPDK_LIB_DIR} -Wl,--whole-archive,${DPDK_LIB},--no-whole-archive")
+ if(DPDK_RTE_LIBRTE_PMD_AESNI_MB OR DPDK_RTE_LIBRTE_PMD_AESNI_GCM)
+ set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,--exclude-libs,libIPSec_MB.a,-l:libIPSec_MB.a")
+ message(STATUS "DPDK depends on IPSec MB library")
+ endif()
+ set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lnuma")
+ add_vpp_plugin(dpdk
+ SOURCES
buffer.c
main.c
thread.c
@@ -100,25 +110,19 @@ if(DPDK_INCLUDE_DIR AND DPDK_LIB)
ipsec/esp_decrypt.c
ipsec/esp_encrypt.c
ipsec/ipsec.c
- api/dpdk.api
- )
- vpp_library_set_multiarch_sources(dpdk_plugin
+ MULTIARCH_SOURCES
buffer.c
device/device.c
device/node.c
- )
- message(STATUS "Found DPDK ${DPDK_VERSION} in ${DPDK_INCLUDE_DIR}")
- get_filename_component(DPDK_LIB_DIR ${DPDK_LIB} DIRECTORY)
- set(DPDK_LINK_FLAGS "-L${DPDK_LIB_DIR} -Wl,--whole-archive,${DPDK_LIB},--no-whole-archive")
- if(DPDK_RTE_LIBRTE_PMD_AESNI_MB OR DPDK_RTE_LIBRTE_PMD_AESNI_GCM)
- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,--exclude-libs,libIPSec_MB.a,-l:libIPSec_MB.a")
- message(STATUS "DPDK depends on IPSec MB library")
- endif()
- set(DPDK_LINK_FLAGS "${DPDK_LINK_FLAGS} -Wl,-lnuma")
- set_target_properties(dpdk_plugin PROPERTIES LINK_FLAGS "${DPDK_LINK_FLAGS}")
+ API_FILES
+ api/dpdk.api
+
+ LINK_FLAGS
+ ${DPDK_LINK_FLAGS}
+ )
else()
- message(WARNING "DPDK not found - dpdk_plugin disabled")
+ message(WARNING "DPDK not found - dpdk disabled")
endif()