[v2] meson: fix building subdirectories separately

Message ID 1551803365-79357-1-git-send-email-andrius.sirvys@intel.com
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [v2] meson: fix building subdirectories separately
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Andrius Sirvys March 5, 2019, 4:29 p.m.
If for debugging we disable the driver directory in the meson.build file,
we get an error because the variable "driver_classes" does not exist.
This is because driver_classes is only defined in the
drivers/meson.build file. Defining driver_classes in dpdk/meson.build file
will make it easier for compiling separate directories.

In the process, we rename driver_classes to dpdk_driver_classes for
consistency with the other variables.

Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
---
v2: Fixed mispellings in commit message
---
 drivers/meson.build | 4 ++--
 meson.build         | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Bruce Richardson March 5, 2019, 5:21 p.m. | #1
On Tue, Mar 05, 2019 at 04:29:25PM +0000, Andrius Sirvys wrote:
> If for debugging we disable the driver directory in the meson.build file,
> we get an error because the variable "driver_classes" does not exist.
> This is because driver_classes is only defined in the
> drivers/meson.build file. Defining driver_classes in dpdk/meson.build file
> will make it easier for compiling separate directories.
> 
> In the process, we rename driver_classes to dpdk_driver_classes for
> consistency with the other variables.
> 
> Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
> ---
> v2: Fixed mispellings in commit message
> ---
This can be useful, and a similar change I saw in the windows RFC since it
is incrementally adding things to the windows build, and so would hit this
error.

Therefore,
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Bruce Richardson March 5, 2019, 5:26 p.m. | #2
On Tue, Mar 05, 2019 at 05:21:12PM +0000, Bruce Richardson wrote:
> On Tue, Mar 05, 2019 at 04:29:25PM +0000, Andrius Sirvys wrote:
> > If for debugging we disable the driver directory in the meson.build file,
> > we get an error because the variable "driver_classes" does not exist.
> > This is because driver_classes is only defined in the
> > drivers/meson.build file. Defining driver_classes in dpdk/meson.build file
> > will make it easier for compiling separate directories.
> > 
> > In the process, we rename driver_classes to dpdk_driver_classes for
> > consistency with the other variables.
> > 
> > Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
> > ---
> > v2: Fixed mispellings in commit message
> > ---
> This can be useful, and a similar change I saw in the windows RFC since it
> is incrementally adding things to the windows build, and so would hit this
> error.
> 
> Therefore,
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Actually, one small thing I should have picked up on earlier - I think the
title could be reworded a bit. It's not a fix since there is nothing
technically wrong with the existing code - it's just harder to go
commenting out parts of the build without this change. How about setting
the title to: "build: move variable definition to top level", or something
similar.

/Bruce
Ranjit Menon March 5, 2019, 6:01 p.m. | #3
On 3/5/2019 9:26 AM, Bruce Richardson wrote:
> On Tue, Mar 05, 2019 at 05:21:12PM +0000, Bruce Richardson wrote:
>> On Tue, Mar 05, 2019 at 04:29:25PM +0000, Andrius Sirvys wrote:
>>> If for debugging we disable the driver directory in the meson.build file,
>>> we get an error because the variable "driver_classes" does not exist.
>>> This is because driver_classes is only defined in the
>>> drivers/meson.build file. Defining driver_classes in dpdk/meson.build file
>>> will make it easier for compiling separate directories.
>>>
>>> In the process, we rename driver_classes to dpdk_driver_classes for
>>> consistency with the other variables.
>>>
>>> Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
>>> ---
>>> v2: Fixed mispellings in commit message
>>> ---
>> This can be useful, and a similar change I saw in the windows RFC since it
>> is incrementally adding things to the windows build, and so would hit this
>> error.
>>
>> Therefore,
>> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Actually, one small thing I should have picked up on earlier - I think the
> title could be reworded a bit. It's not a fix since there is nothing
> technically wrong with the existing code - it's just harder to go
> commenting out parts of the build without this change. How about setting
> the title to: "build: move variable definition to top level", or something
> similar.
> 
> /Bruce
> 
Yes. This will help with the Windows port.

Acked-by: Ranjit Menon <ranjit.menon@intel.com>

Patch

diff --git a/drivers/meson.build b/drivers/meson.build
index c3c66bb..ebe1104 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -2,7 +2,7 @@ 
 # Copyright(c) 2017 Intel Corporation
 
 # Defines the order in which the drivers are buit.
-driver_classes = ['common',
+dpdk_driver_classes = ['common',
 	       'bus',
 	       'mempool', # depends on common and bus.
 	       'net',     # depends on common, bus and mempool.
@@ -20,7 +20,7 @@  endif
 # specify -D_GNU_SOURCE unconditionally
 default_cflags += '-D_GNU_SOURCE'
 
-foreach class:driver_classes
+foreach class:dpdk_driver_classes
 	drivers = []
 	std_deps = []
 	config_flag_fmt = '' # format string used to set the value in dpdk_conf
diff --git a/meson.build b/meson.build
index 7f5e867..7785251 100644
--- a/meson.build
+++ b/meson.build
@@ -13,6 +13,7 @@  cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
 dpdk_libraries = []
 dpdk_static_libraries = []
+dpdk_driver_classes = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_app_link_libraries = []
@@ -110,7 +111,7 @@  message(output_message + '\n')
 # track driver lists easily
 if meson.version().version_compare('>=0.47')
 	output_message = '\n===============\nDrivers Enabled\n===============\n'
-	foreach class:driver_classes
+	foreach class:dpdk_driver_classes
 		class_drivers = get_variable(class + '_drivers')
 		output_message += '\n' + class + ':\n\t'
 		output_count = 0