[2/2] build: export dpdk_includes for subproject usage.

Message ID 20221012144704.77973-2-markus.theil@tu-ilmenau.de (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] build: allow to conditionally build apps |

Checks

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

Commit Message

Markus Theil Oct. 12, 2022, 2:47 p.m. UTC
From: Thorben Roemer <thorben.roemer@secunet.com>

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: Thorben Roemer <thorben.roemer@secunet.com>
---
 drivers/meson.build | 1 +
 lib/meson.build     | 1 +
 meson.build         | 1 +
 3 files changed, 3 insertions(+)
  

Comments

Bruce Richardson Oct. 12, 2022, 3:21 p.m. UTC | #1
On Wed, Oct 12, 2022 at 04:47:04PM +0200, Markus Theil wrote:
> From: Thorben Roemer <thorben.roemer@secunet.com>
> 
> 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: Thorben Roemer <thorben.roemer@secunet.com>
> ---
>  drivers/meson.build | 1 +
>  lib/meson.build     | 1 +
>  meson.build         | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 216971f4e2..d19b47df12 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -95,6 +95,7 @@ foreach subpath:subdirs
>          objs = []
>          cflags = default_cflags
>          includes = [include_directories(drv_path)]
> +        dpdk_includes += [include_directories(drv_path)]

I am not sure that by default we should include all the driver directories.
At most, we should only include those drivers which have header files to be
made public. I think initially though we should only export library paths.

/Bruce
  
Markus Theil Oct. 13, 2022, 3:12 p.m. UTC | #2
On 10/12/22 17:21, Bruce Richardson wrote:
> On Wed, Oct 12, 2022 at 04:47:04PM +0200, Markus Theil wrote:
>> From: Thorben Roemer <thorben.roemer@secunet.com>
>>
>> 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: Thorben Roemer <thorben.roemer@secunet.com>
>> ---
>>   drivers/meson.build | 1 +
>>   lib/meson.build     | 1 +
>>   meson.build         | 1 +
>>   3 files changed, 3 insertions(+)
>>
>> diff --git a/drivers/meson.build b/drivers/meson.build
>> index 216971f4e2..d19b47df12 100644
>> --- a/drivers/meson.build
>> +++ b/drivers/meson.build
>> @@ -95,6 +95,7 @@ foreach subpath:subdirs
>>           objs = []
>>           cflags = default_cflags
>>           includes = [include_directories(drv_path)]
>> +        dpdk_includes += [include_directories(drv_path)]
> I am not sure that by default we should include all the driver directories.
> At most, we should only include those drivers which have header files to be
> made public. I think initially though we should only export library paths.
I tried to only include libraries. At least for our DPDK-based 
application, the bonding and i40e includes are needed. I therefore tried 
to include all drivers exporting symbols to the dpdk_includes list in 
the following revision.
> /Bruce
>
  

Patch

diff --git a/drivers/meson.build b/drivers/meson.build
index 216971f4e2..d19b47df12 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -95,6 +95,7 @@  foreach subpath:subdirs
         objs = []
         cflags = default_cflags
         includes = [include_directories(drv_path)]
+        dpdk_includes += [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
         # ext_deps: Stores external library dependency got
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 = []