[v4,2/2] build: export dpdk_includes for subproject usage

Message ID 20221014075118.10083-2-markus.theil@tu-ilmenau.de (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [v4,1/2] build: allow to conditionally build apps |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Markus Theil Oct. 14, 2022, 7:51 a.m. UTC
In order to perform things like LTO more easily in
our DPDK applications, we use DPDK as a meson subproject.
Also export includes in order to be usable in this context.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 drivers/meson.build | 4 ++++
 lib/meson.build     | 1 +
 meson.build         | 1 +
 3 files changed, 6 insertions(+)
  

Comments

Bruce Richardson Oct. 14, 2022, 8:45 a.m. UTC | #1
On Fri, Oct 14, 2022 at 09:51:18AM +0200, Markus Theil wrote:
> In order to perform things like LTO more easily in
> our DPDK applications, we use DPDK as a meson subproject.
> Also export includes in order to be usable in this context.
> 
> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  

Patch

diff --git a/drivers/meson.build b/drivers/meson.build
index 216971f4e2..15ac600768 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -174,6 +174,10 @@  foreach subpath:subdirs
             install_headers(driver_sdk_headers)
         endif
 
+        if headers.length() > 0
+            dpdk_includes += include_directories(drv_path)
+        endif
+
         # generate pmdinfo sources by building a temporary
         # lib and then running pmdinfogen on the contents of
         # that lib. The final lib reuses the object files and
diff --git a/lib/meson.build b/lib/meson.build
index f858844fa2..85113d0b47 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -190,6 +190,7 @@  foreach l:libraries
 
     libname = 'rte_' + name
     includes += include_directories(l)
+    dpdk_includes += include_directories(l)
 
     if developer_mode and is_windows and use_function_versioning
         message('@0@: Function versioning is not supported by Windows.'.format(name))
diff --git a/meson.build b/meson.build
index 1d35a255c3..d1cf039297 100644
--- a/meson.build
+++ b/meson.build
@@ -32,6 +32,7 @@  cc = meson.get_compiler('c')
 dpdk_source_root = meson.current_source_dir()
 dpdk_build_root = meson.current_build_dir()
 dpdk_conf = configuration_data()
+dpdk_includes = []
 dpdk_libraries = []
 dpdk_static_libraries = []
 dpdk_shared_lib_deps = []