diff mbox series

[v8,05/14] build: simplify how Arm flags are processed

Message ID 1604649795-27476-6-git-send-email-juraj.linkes@pantheon.tech (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series Arm build options rework | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš Nov. 6, 2020, 8:03 a.m. UTC
Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

Comments

Honnappa Nagarahalli Nov. 8, 2020, 3:19 a.m. UTC | #1
<snip>

> 
> Set flags in one loop. Append flags to a list and use the list in the loop.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/meson.build | 37 +++++++++++++++++--------------------
>  1 file changed, 17 insertions(+), 20 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 5b922ef9c..eda485e7f 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')  else
>  	# aarch64 build
>  	implementer_id = 'generic'
> -	machine_args = [] # Clear previous machine args
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
>  		implementer_config = implementer_generic @@ -183,34
> +182,32 @@ else
>  		implementer_config = get_variable('implementer_' +
> implementer_id)
>  	endif
> 
> -	# Apply Common Defaults. These settings may be overwritten by
> machine
> -	# settings later.
> -	foreach flag: flags_common_default
> -		if flag.length() > 0
> -			dpdk_conf.set(flag[0], flag[1])
> -		endif
> -	endforeach
> +	message('Arm implementer: ' + implementer_config[0])
> +	message('Arm part number: ' + part_number)
> 
> -	message('Implementer : ' + implementer_config[0])
> -	foreach flag: implementer_config[1]
> -		if flag.length() > 0
> -			dpdk_conf.set(flag[0], flag[1])
> -		endif
> -	endforeach
> +	# use default flags with implementer flags
> +	dpdk_flags = flags_common_default + implementer_config[1]
> 
> +	machine_args = [] # Clear previous machine args
>  	foreach marg: implementer_config[2]
>  		if marg[0] == part_number
> +			# apply supported machine args
>  			foreach flag: marg[1]
>  				if cc.has_argument(flag)
>  					machine_args += flag
>  				endif
>  			endforeach
> -			# Apply any extra machine specific flags.
> -			foreach flag: marg.get(2, [])
> -				if flag.length() > 0
> -					dpdk_conf.set(flag[0], flag[1])
> -				endif
> -			endforeach
> +			if marg.length() > 2
> +				# add extra flags for the part
> +				dpdk_flags += marg[2]
> +			endif
> +		endif
> +	endforeach
> +
> +	# apply flags
> +	foreach flag: dpdk_flags
> +		if flag.length() > 0
> +			dpdk_conf.set(flag[0], flag[1])
>  		endif
>  	endforeach
>  endif
> --
> 2.20.1
diff mbox series

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 5b922ef9c..eda485e7f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -150,7 +150,6 @@  if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -183,34 +182,32 @@  else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common_default
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common_default + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			foreach flag: marg[1]
 				if cc.has_argument(flag)
 					machine_args += flag
 				endif
 			endforeach
-			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif