summaryrefslogtreecommitdiffstats
path: root/src/plugins/dev_octeon/CMakeLists.txt
blob: 0f6b32bbecdee189ba8c97ead77d87f74261e36f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# SPDX-License-Identifier: Apache-2.0
# Copyright(c) 2022 Cisco Systems, Inc.

if (NOT VPP_PLATFORM_NAME STREQUAL "octeon10" AND NOT VPP_PLATFORM_NAME STREQUAL "octeon9")
  return()
endif()

# Find OCTEON roc files
vpp_find_path(OCTEON_ROC_DIR PATH_SUFFIXES octeon-roc NAMES platform.h)
vpp_plugin_find_library(dev-octeon OCTEON_ROC_LIB "libocteon-roc.a")

if (NOT OCTEON_ROC_DIR)
  message("OCTEON ROC files not found - Marvell OCTEON device plugin disabled")
  return()
endif()

if (NOT OCTEON_ROC_LIB)
  message("OCTEON ROC library (libocteon-roc.a) not found - Marvell OCTEON device plugin disabled")
  return ()
endif()

include_directories (${OCTEON_ROC_DIR}/)

if (VPP_PLATFORM_NAME STREQUAL "octeon9")
   add_compile_definitions(PLATFORM_OCTEON9)
endif()

add_vpp_plugin(dev_octeon
  SOURCES
  init.c
  format.c
  port.c
  queue.c
  roc_helper.c
  rx_node.c
  tx_node.c
  flow.c

  MULTIARCH_SOURCES
  rx_node.c
  tx_node.c

  LINK_LIBRARIES
  ${OCTEON_ROC_LIB}
)