Skip to content

Commit 841e427

Browse files
anoobjjerinjacobk
authored andcommitted
lib: enable non ARM build for libs
Enable non ARM builds for libs and apps. When the platform is not ARM, the build is treated as host build and only the libs & apps required to be run on host would be build. If the platform is ARM but the build is for host, then the new option ('enable_host_build') can be used. Signed-off-by: Anoob Joseph <anoobj@marvell.com> Change-Id: I49c9f46e4aac1c4f5e418dc559e46fab6550b43b Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/142460 Tested-by: sa_ip-toolkits-Jenkins <sa_ip-toolkits-jenkins@marvell.com> (cherry picked from commit 17176230fabdce37503f6c62e35e29c50707e182) Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/143762 Reviewed-by: Jerin Jacob <jerinj@marvell.com>
1 parent 747e81c commit 841e427

File tree

16 files changed

+81
-16
lines changed

16 files changed

+81
-16
lines changed

app/ovs-offload/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# Application Sources
55
sources = []
66

7+
if host_build
8+
skip_app = true
9+
endif
10+
711
# Include directories
812
includes += include_directories(['include'])
913

app/smart-nic/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# Application Sources
55
sources = []
66

7+
if host_build
8+
skip_app = true
9+
endif
10+
711
# Include directories
812
includes += include_directories(['include'])
913

doc/guides/gsg/build.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ documentation will be built by default.
7676

7777
Meson Options
7878
-------------
79-
- kernel_dir: Path to the kernel for building kernel modules (octep_vdpa).
79+
- **kernel_dir**: Path to the kernel for building kernel modules (octep_vdpa).
8080
Headers must be in $kernel_dir.
81-
- dma_stats: Enable DMA statistics for DAO library
82-
- virtio_debug: Enable virtio debug that perform descriptor validation, etc.
81+
- **dma_stats**: Enable DMA statistics for DAO library
82+
- **virtio_debug**: Enable virtio debug that perform descriptor validation, etc.
83+
- **enable_host_build**: Enable the host build for the DAO library. This option
84+
compiles only the components necessary for the host environment.

lib/common/meson.build

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ configure_file(
99
install_dir: '.'
1010
)
1111

12-
sources = files(
13-
'dma.c',
14-
'dao_bitmap.c',
15-
'dao_log.c',
16-
'dao_util.c',
17-
'dao_dynamic_string.c'
18-
)
12+
if host_build
13+
sources = files(
14+
'dao_log.c',
15+
)
16+
else
17+
sources = files(
18+
'dma.c',
19+
'dao_bitmap.c',
20+
'dao_log.c',
21+
'dao_util.c',
22+
'dao_dynamic_string.c'
23+
)
24+
endif
1925

2026
headers = files(
2127
'dao_bitmap.h',

lib/featurearc/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
deps += ['common']
55

6+
if host_build
7+
skip_lib = true
8+
endif
9+
610
sources = files(
711
'feature_arc.c'
812
)

lib/flow/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-MIT
22
# Copyright (c) 2024 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
sources = files(
59
'dao_flow.c',
610
'flow_acl.c',

lib/netlink/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ if not DAO_BUILD_CONF.has('DAO_LIBNL_DEP')
77
subdir_done()
88
endif
99

10+
if host_build
11+
skip_lib = true
12+
endif
13+
1014
deps += ['common']
1115

1216
sources = files(

lib/pal/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-MIT
22
# Copyright (c) 2024 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
sources = files(
59
'dao_pal.c',
610
)

lib/pem/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-MIT
22
# Copyright (c) 2023 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
sources = files(
59
'pem.c',
610
'sdp.c'

lib/portgroup/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-MIT
22
# Copyright (c) 2023 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
deps += ['common']
59

610
sources = files(

lib/vfio/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-MIT
22
# Copyright (c) 2024 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
sources = files(
59
'dao_vfio_platform.c'
610
)

lib/virtio/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-Proprietary
22
# Copyright (c) 2023 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
sources = files(
59
'virtio_dev.c',
610
'virtio_mbox.c',

lib/virtio_net/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-Proprietary
22
# Copyright (c) 2023 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
sources = files(
59
'virtio_net_deq.c',
610
'virtio_net_enq.c',

lib/workers/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Marvell-MIT
22
# Copyright (c) 2023 Marvell.
33

4+
if host_build
5+
skip_lib = true
6+
endif
7+
48
deps += ['common']
59

610
sources = files(

meson.build

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ DAO_STATIC_LIBS = []
2424
DAO_MODULES_ENABLED = []
2525
DAO_MODULES_DISABLED = []
2626

27+
host_build = false
28+
if (get_option('enable_host_build'))
29+
host_build = true
30+
endif
31+
32+
# If CPU is not ARM, treat as host build
33+
if host_machine.cpu_family() != 'aarch64'
34+
host_build = true
35+
endif
2736

2837
dpdk_version = run_command(find_program('cat', 'more'),
2938
files('DPDK_VERSION'), check: true).stdout().strip()
@@ -33,12 +42,10 @@ subdir('dep')
3342
subdir('config')
3443

3544
# Mandatory dependency
36-
if host_machine.cpu_family() == 'aarch64'
37-
if DAO_BUILD_CONF.has('DAO_LIBDPDK_DEP')
38-
subdir('lib')
39-
subdir('app')
40-
subdir('tests')
41-
endif
45+
if DAO_BUILD_CONF.has('DAO_LIBDPDK_DEP')
46+
subdir('lib')
47+
subdir('app')
48+
subdir('tests')
4249
endif
4350

4451
doxygen = find_program('doxygen', required: false)

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ option('platform', type: 'string', value: 'native', description:
1111
'Platform to build.')
1212
option('enable_kmods', type: 'boolean', value: true, description:
1313
'build kernel modules')
14+
option('enable_host_build', type: 'boolean', value: false, description:
15+
'Build DAO packages required for host only.')

0 commit comments

Comments
 (0)