build: fix compatibility with meson 0.47

Message ID 20191024104108.2331-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Headers
Series build: fix compatibility with meson 0.47 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail apply issues

Commit Message

Bruce Richardson Oct. 24, 2019, 10:41 a.m. UTC
  The "in" keyword was introduced in meson 0.49, which means we need to use
an old-fashioned loop to check the array of disabled drivers.

Fixes: 6f80f1cd2247 ("build: support disabling drivers with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
  

Comments

Luca Boccassi Oct. 24, 2019, 12:17 p.m. UTC | #1
On Thu, 2019-10-24 at 11:41 +0100, Bruce Richardson wrote:
> The "in" keyword was introduced in meson 0.49, which means we need to
> use
> an old-fashioned loop to check the array of disabled drivers.
> 
> Fixes: 6f80f1cd2247 ("build: support disabling drivers with meson")
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  drivers/meson.build | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 4a1cb8b5b..156d2dc71 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -61,10 +61,15 @@ foreach class:dpdk_driver_classes
>  		# pull in driver directory which should assign to each
> of the above
>  		subdir(drv_path)
>  
> -		if drv_path in disabled_drivers
> -			build = false
> -			reason = 'Explicitly disabled via build config'
> -		elif build
> +		# skip disabled drivers. For meson 0.49 change this to
> use
> +		# "in" keyword
> +		foreach disable_path: disabled_drivers
> +			if drv_path == disable_path
> +				build = false
> +				reason = 'Explicitly disabled via build
> config'
> +			endif
> +		endforeach
> +		if build
>  			# get dependency objs from strings
>  			shared_deps = ext_deps
>  			static_deps = ext_deps
> 

Acked-by: Luca Boccassi <bluca@debian.org>
  
Thomas Monjalon Oct. 25, 2019, 7:44 a.m. UTC | #2
24/10/2019 14:17, Luca Boccassi:
> On Thu, 2019-10-24 at 11:41 +0100, Bruce Richardson wrote:
> > The "in" keyword was introduced in meson 0.49, which means we need to
> > use an old-fashioned loop to check the array of disabled drivers.
> > 
> > Fixes: 6f80f1cd2247 ("build: support disabling drivers with meson")
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Acked-by: Luca Boccassi <bluca@debian.org>

Applied, thanks
  

Patch

diff --git a/drivers/meson.build b/drivers/meson.build
index 4a1cb8b5b..156d2dc71 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -61,10 +61,15 @@  foreach class:dpdk_driver_classes
 		# pull in driver directory which should assign to each of the above
 		subdir(drv_path)
 
-		if drv_path in disabled_drivers
-			build = false
-			reason = 'Explicitly disabled via build config'
-		elif build
+		# skip disabled drivers. For meson 0.49 change this to use
+		# "in" keyword
+		foreach disable_path: disabled_drivers
+			if drv_path == disable_path
+				build = false
+				reason = 'Explicitly disabled via build config'
+			endif
+		endforeach
+		if build
 			# get dependency objs from strings
 			shared_deps = ext_deps
 			static_deps = ext_deps