Skip to content

Commit

Permalink
dep: add grpc as build dependency
Browse files Browse the repository at this point in the history
detect re2, protoc, grpc_cpp_plugin, protobuf library
and add grpc build dependencies

Individual lib or app can use GRPC as follows

for library use: lib_deps += DAO_EXT_DEPS_GRPC
for application use: app_deps += DAO_EXT_DEPS_GRPC

Signed-off-by: Nitin Saxena <nsaxena@marvell.com>
Change-Id: I5cabd877461000d8a8ed1dcce8a39a27bf3bd8f0
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/141618
Reviewed-by: Ashwin Sekhar T K <asekhar@marvell.com>
Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com>
  • Loading branch information
nsaxena16 committed Feb 26, 2025
1 parent 5b5111e commit 3ebf0c6
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ci/build/config/arm64_cn10k_linux_gcc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[binaries]
c = ['ccache', 'aarch64-marvell-linux-gnu-gcc']
cpp = ['ccache', 'aarch64-marvell-linux-gnu-cpp']
cpp = ['ccache', 'aarch64-marvell-linux-gnu-g++']
ar = 'aarch64-marvell-linux-gnu-gcc-ar'
strip = 'aarch64-marvell-linux-gnu-strip'
pkgconfig = 'pkg-config'
Expand Down
2 changes: 1 addition & 1 deletion config/arm64_cn10k_linux_gcc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[binaries]
c = ['ccache', 'aarch64-marvell-linux-gnu-gcc']
cpp = ['ccache', 'aarch64-marvell-linux-gnu-cpp']
cpp = ['ccache', 'aarch64-marvell-linux-gnu-g++']
ar = 'aarch64-marvell-linux-gnu-gcc-ar'
strip = 'aarch64-marvell-linux-gnu-strip'
pkgconfig = 'pkg-config'
Expand Down
37 changes: 37 additions & 0 deletions dep/grpc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: Marvell-MIT
# Copyright (c) 2025 Marvell.

protoc = find_program('protoc', required:false)
grpc_cpp_plugin = find_program('grpc_cpp_plugin', required:false)
re2_dep = dependency('re2', method : 'pkg-config', version: '>=11.0.0', required:false)
grpcplus_dep = dependency('grpc++', method : 'pkg-config', version: '>=1.65.0', required:false)
protobuf_dep = dependency('protobuf', method : 'pkg-config', version:'>=27.2.0', required:false)

if not protoc.found()
message('protobuf compiler (protoc) not found')
subdir_done()
endif

if not grpc_cpp_plugin.found()
message('grpc_cpp_plugin not found')
subdir_done()
endif

if not re2_dep.found()
message('re2 not found')
subdir_done()
endif

if not protobuf_dep.found()
message('protobuf pkgconfig not exported')
subdir_done()
endif

if not grpcplus_dep.found()
message('grpcplus pkgconfig not exported')
subdir_done()
endif

DAO_BUILD_CONF.set('DAO_GRPC_DEP', '1')
DAO_EXT_DEPS_GRPC += grpcplus_dep
DAO_EXT_DEPS_GRPC += protobuf_dep
1 change: 1 addition & 0 deletions dep/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

subdir('dpdk')
subdir('libnl')
subdir('grpc')
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

project(
'Data Accelerator Offload',
'C',
'C', 'CPP',
meson_version: '>= 0.61.0',
version: run_command(find_program('cat', 'more'),
files('VERSION'), check: true).stdout().strip(),
default_options: ['warning_level=2', 'werror=true', 'buildtype=release']
default_options: ['warning_level=2', 'werror=true', 'buildtype=release','cpp_std=c++17']
)

# Build Configuration Data
Expand All @@ -21,6 +21,8 @@ DAO_INCLUDES = []
DAO_EXT_DEPS_LIBDPDK = []
# LIBNL
DAO_EXT_DEPS_LIBNL = []
# GRPC
DAO_EXT_DEPS_GRPC = []
# DAO static libraries
DAO_STATIC_LIBS = []
# Enabled/disabled static dao applicaitons/libraries/tests
Expand Down

0 comments on commit 3ebf0c6

Please sign in to comment.