Skip to contentSkip to conversation

build: pass cflags in subproject

PATCH Applied Robin Jarry 3 participants 3 messages Mar 8, 2024 – Mar 15, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: pass cflags in subproject

When DPDK is used as a subproject, include the required compile arguments so that the parent project is also built with the appropriate cflags (most importantly -march). Use the same cflags as pkg-config.

Fixes f93a605f2d6e ("build: add definitions for use as Meson subproject")
---
 buildtools/subproject/meson.build | 6 ++++++
 1 file changed, 6 insertions(+)
buildtools/subproject/meson.build +6 -0
index 322e01c02969..203c5d36c6e9 100644
@@ -2,10 +2,15 @@
 # Copyright(c) 2022 Intel Corporation
 
 message('DPDK subproject linking: ' + get_option('default_library'))
+subproject_cflags = ['-include', 'rte_config.h'] + machine_args
+if is_freebsd
+    subproject_cflags += ['-D__BSD_VISIBLE']
+endif
 if get_option('default_library') == 'static'
     dpdk_dep = declare_dependency(
             version: meson.project_version(),
             dependencies: dpdk_static_lib_deps,
+            compile_args: subproject_cflags,
             # static library deps in DPDK build don't include "link_with" parameters,
             # so explicitly link-in both libs and drivers
             link_whole: dpdk_static_libraries + dpdk_drivers,
@@ -13,6 +18,7 @@ if get_option('default_library') == 'static'
 else
     dpdk_dep = declare_dependency(
             version: meson.project_version(),
+            compile_args: subproject_cflags,
             # shared library deps include all necessary linking parameters
             dependencies: dpdk_shared_lib_deps)
 endif
Signature · 1 line
2.44.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Robin Jarry

When DPDK is used as a subproject, include the required compile arguments so that the parent project is also built with the appropriate cflags (most importantly -march). Use the same cflags as pkg-config.

Fixes f93a605f2d6e ("build: add definitions for use as Meson subproject")
Signature · 1 line
David Marchand
#2 lore raw

08/03/2024 15:24, David Marchand:

Quoted 6 lines · Robin Jarry
Quoted 5 lines

When DPDK is used as a subproject, include the required compile arguments so that the parent project is also built with the appropriate cflags (most importantly -march). Use the same cflags as pkg-config.

Quoted 6 lines
Quoted 4 lines
Fixes f93a605f2d6e ("build: add definitions for use as Meson subproject")

Applied, thanks.