From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 8C95BA0524;
	Fri,  6 Nov 2020 09:04:48 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 587525946;
	Fri,  6 Nov 2020 09:03:31 +0100 (CET)
Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20])
 by dpdk.org (Postfix) with ESMTP id EAC7154AE
 for <dev@dpdk.org>; Fri,  6 Nov 2020 09:03:27 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by lb.pantheon.sk (Postfix) with ESMTP id 71AF5B6B72;
 Fri,  6 Nov 2020 09:03:24 +0100 (CET)
X-Virus-Scanned: amavisd-new at siecit.sk
Received: from lb.pantheon.sk ([127.0.0.1])
 by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id roJboMTdtFzI; Fri,  6 Nov 2020 09:03:23 +0100 (CET)
Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141])
 by lb.pantheon.sk (Postfix) with ESMTP id C3EFCB6B64;
 Fri,  6 Nov 2020 09:03:20 +0100 (CET)
From: =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com,
 Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com,
 Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com,
 ajit.khaparde@broadcom.com, ferruh.yigit@intel.com, aconole@redhat.com
Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
Date: Fri,  6 Nov 2020 09:03:06 +0100
Message-Id: <1604649795-27476-6-git-send-email-juraj.linkes@pantheon.tech>
X-Mailer: git-send-email 2.7.4
In-Reply-To: <1604649795-27476-1-git-send-email-juraj.linkes@pantheon.tech>
References: <1604584762-25321-1-git-send-email-juraj.linkes@pantheon.tech>
 <1604649795-27476-1-git-send-email-juraj.linkes@pantheon.tech>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are
	processed
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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(-)

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