DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, david.marchand@redhat.com, bluca@debian.org,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [RFC PATCH 07/14] build: reduce indentation in examples build spec
Date: Thu,  1 Apr 2021 12:50:02 +0100	[thread overview]
Message-ID: <20210401115009.1063844-8-bruce.richardson@intel.com> (raw)
In-Reply-To: <20210401115009.1063844-1-bruce.richardson@intel.com>

As with the lib and drivers directories, we can use "continue" keyword to
reduce the indentation level of the majority of the foreach block. At the
same time, we can also replace tab indentation with spaces.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/meson.build | 158 ++++++++++++++++++++++---------------------
 1 file changed, 80 insertions(+), 78 deletions(-)

diff --git a/examples/meson.build b/examples/meson.build
index d065a6a08b..b9518d687c 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -3,109 +3,111 @@
 
 link_whole_libs = []
 if get_option('default_library') == 'static'
-	link_whole_libs = dpdk_static_libraries + dpdk_drivers
+    link_whole_libs = dpdk_static_libraries + dpdk_drivers
 endif
 
 # list of all example apps. Keep 1-3 per line, in alphabetical order.
 all_examples = [
-	'bbdev_app', 'bond',
-	'cmdline',
-	'distributor', 'ethtool',
-	'eventdev_pipeline',
-	'fips_validation', 'flow_classify',
-	'flow_filtering', 'helloworld',
-	'ioat',
-	'ip_fragmentation', 'ip_pipeline',
-	'ip_reassembly', 'ipsec-secgw',
-	'ipv4_multicast', 'kni',
-	'l2fwd', 'l2fwd-cat', 'l2fwd-event',
-	'l2fwd-crypto', 'l2fwd-jobstats',
-	'l2fwd-keepalive', 'l3fwd',
-	'l3fwd-acl', 'l3fwd-power', 'l3fwd-graph',
-	'link_status_interrupt',
-	'multi_process/client_server_mp/mp_client',
-	'multi_process/client_server_mp/mp_server',
-	'multi_process/hotplug_mp',
-	'multi_process/simple_mp',
-	'multi_process/symmetric_mp',
-	'ntb', 'packet_ordering',
-	'performance-thread/l3fwd-thread',
-	'performance-thread/pthread_shim',
-	'pipeline',
-	'ptpclient',
-	'qos_meter', 'qos_sched',
-	'rxtx_callbacks',
-	'server_node_efd/node',
-	'server_node_efd/server',
-	'service_cores',
-	'skeleton',
-	'timer', 'vdpa',
-	'vhost', 'vhost_crypto',
-	'vhost_blk', 'vm_power_manager',
-	'vm_power_manager/guest_cli',
-	'vmdq', 'vmdq_dcb',
+    'bbdev_app', 'bond',
+    'cmdline',
+    'distributor', 'ethtool',
+    'eventdev_pipeline',
+    'fips_validation', 'flow_classify',
+    'flow_filtering', 'helloworld',
+    'ioat',
+    'ip_fragmentation', 'ip_pipeline',
+    'ip_reassembly', 'ipsec-secgw',
+    'ipv4_multicast', 'kni',
+    'l2fwd', 'l2fwd-cat', 'l2fwd-event',
+    'l2fwd-crypto', 'l2fwd-jobstats',
+    'l2fwd-keepalive', 'l3fwd',
+    'l3fwd-acl', 'l3fwd-power', 'l3fwd-graph',
+    'link_status_interrupt',
+    'multi_process/client_server_mp/mp_client',
+    'multi_process/client_server_mp/mp_server',
+    'multi_process/hotplug_mp',
+    'multi_process/simple_mp',
+    'multi_process/symmetric_mp',
+    'ntb', 'packet_ordering',
+    'performance-thread/l3fwd-thread',
+    'performance-thread/pthread_shim',
+    'pipeline',
+    'ptpclient',
+    'qos_meter', 'qos_sched',
+    'rxtx_callbacks',
+    'server_node_efd/node',
+    'server_node_efd/server',
+    'service_cores',
+    'skeleton',
+    'timer', 'vdpa',
+    'vhost', 'vhost_crypto',
+    'vhost_blk', 'vm_power_manager',
+    'vm_power_manager/guest_cli',
+    'vmdq', 'vmdq_dcb',
 ]
 
 # on install, skip copying all meson.build files
 ex_file_excludes = ['meson.build']
 foreach ex:all_examples
-	ex_file_excludes += [ex + '/meson.build']
+    ex_file_excludes += [ex + '/meson.build']
 endforeach
 
 if get_option('examples') == ''
-	subdir_done()
+    subdir_done()
 endif
 
 if get_option('examples').to_lower() == 'all'
-	examples = all_examples
-	allow_skips = true # don't flag an error if we can't build an app
+    examples = all_examples
+    allow_skips = true # don't flag an error if we can't build an app
 else
-	examples = get_option('examples').split(',')
-	allow_skips = false # error out if we can't build a requested app
+    examples = get_option('examples').split(',')
+    allow_skips = false # error out if we can't build a requested app
 endif
 default_cflags = machine_args
 if cc.has_argument('-Wno-format-truncation')
-	default_cflags += '-Wno-format-truncation'
+    default_cflags += '-Wno-format-truncation'
 endif
 default_ldflags = dpdk_extra_ldflags
 if get_option('default_library') == 'static' and not is_windows
-	default_ldflags += ['-Wl,--export-dynamic']
+    default_ldflags += ['-Wl,--export-dynamic']
 endif
 
 foreach example: examples
-	name = example.split('/')[-1]
-	build = true
-	sources = []
-	allow_experimental_apis = false
-	cflags = default_cflags
-	ldflags = default_ldflags
+    name = example.split('/')[-1]
+    build = true
+    sources = []
+    allow_experimental_apis = false
+    cflags = default_cflags
+    ldflags = default_ldflags
 
-	ext_deps = []
-	includes = [include_directories(example)]
-	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
-	subdir(example)
+    ext_deps = []
+    includes = [include_directories(example)]
+    deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    subdir(example)
 
-	if build
-		dep_objs = ext_deps
-		foreach d:deps
-			var_name = get_option('default_library') + '_rte_' + d
-			if not is_variable(var_name)
-				error('Missing dependency "@0@" for example "@1@"'.format(d, name))
-			endif
-			dep_objs += [get_variable(var_name)]
-		endforeach
-		if allow_experimental_apis
-			cflags += '-DALLOW_EXPERIMENTAL_API'
-		endif
-		executable('dpdk-' + name, sources,
-			include_directories: includes,
-			link_whole: link_whole_libs,
-			link_args: ldflags,
-			c_args: cflags,
-			dependencies: dep_objs)
-	elif not allow_skips
-		error('Cannot build requested example "' + name + '"')
-	else
-		message('Skipping example "' + name + '"')
-	endif
+    if not build
+        if not allow_skips
+            error('Cannot build requested example "' + name + '"')
+        endif
+        message('Skipping example "' + name + '"')
+        continue
+    endif
+
+    dep_objs = ext_deps
+    foreach d:deps
+        var_name = get_option('default_library') + '_rte_' + d
+        if not is_variable(var_name)
+            error('Missing dependency "@0@" for example "@1@"'.format(d, name))
+        endif
+        dep_objs += [get_variable(var_name)]
+    endforeach
+    if allow_experimental_apis
+        cflags += '-DALLOW_EXPERIMENTAL_API'
+    endif
+    executable('dpdk-' + name, sources,
+            include_directories: includes,
+            link_whole: link_whole_libs,
+            link_args: ldflags,
+            c_args: cflags,
+            dependencies: dep_objs)
 endforeach
-- 
2.27.0


  parent reply	other threads:[~2021-04-01 11:51 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 11:49 [dpdk-dev] [RFC PATCH 00/14] Build file update proposals Bruce Richardson
2021-04-01 11:49 ` [dpdk-dev] [RFC PATCH 01/14] editorconfig: add entry for meson files Bruce Richardson
2021-04-01 11:49 ` [dpdk-dev] [RFC PATCH 02/14] build: simplify library build file Bruce Richardson
2021-04-01 11:49 ` [dpdk-dev] [RFC PATCH 03/14] build: correct indentation in list of libs Bruce Richardson
2021-04-01 13:30   ` Thomas Monjalon
2021-04-01 14:01     ` Bruce Richardson
2021-04-01 11:49 ` [dpdk-dev] [RFC PATCH 04/14] build: simplify the driver build configuration file Bruce Richardson
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 05/14] build: clean up driver list indentation Bruce Richardson
2021-04-01 12:14   ` Andrew Rybchenko
2021-04-01 12:33     ` Bruce Richardson
2021-04-01 12:40       ` Andrew Rybchenko
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 06/14] build: reduce indentation in app build spec Bruce Richardson
2021-04-01 13:32   ` Thomas Monjalon
2021-04-01 14:05     ` Bruce Richardson
2021-04-01 11:50 ` Bruce Richardson [this message]
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 08/14] build: change infrastructure file tabs to spaces Bruce Richardson
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 09/14] lib: change meson " Bruce Richardson
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 10/14] drivers: " Bruce Richardson
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 11/14] examples: " Bruce Richardson
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 12/14] app: " Bruce Richardson
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 13/14] lib: remove librte_ prefix from directory names Bruce Richardson
2021-04-01 13:42   ` Thomas Monjalon
2021-04-01 11:50 ` [dpdk-dev] [RFC PATCH 14/14] lib: allow disabling optional libraries Bruce Richardson
2021-04-01 12:27 ` [dpdk-dev] [RFC PATCH 00/14] Build file update proposals Andrew Rybchenko
2021-04-01 13:15   ` Luca Boccassi
2021-04-01 13:36 ` Thomas Monjalon
2021-04-01 14:10   ` Bruce Richardson
2021-04-16 17:04 ` [dpdk-dev] [PATCH 00/14] Build file updates Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 01/14] build: simplify library build file Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 02/14] build: tidy up list of libraries to build Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 03/14] build: simplify the driver build configuration file Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 04/14] build: clean up driver lists Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 05/14] build: reduce indentation in app build spec Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 06/14] build: reduce indentation in examples " Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 07/14] build: change infrastructure file tabs to spaces Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 08/14] lib: cleanup whitespace in meson build files Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 09/14] drivers: change meson file tabs to spaces Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 10/14] examples: " Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 11/14] app: " Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 12/14] editorconfig: add entry for meson files Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 13/14] lib: remove librte_ prefix from directory names Bruce Richardson
2021-04-16 17:04   ` [dpdk-dev] [PATCH 14/14] lib: allow disabling optional libraries Bruce Richardson
2021-04-18  8:45   ` [dpdk-dev] [PATCH 00/14] Build file updates Xueming(Steven) Li
2021-04-19 13:06     ` Bruce Richardson
2021-04-21 13:01       ` Xueming(Steven) Li
2021-04-21 15:52         ` Xueming(Steven) Li
2021-04-19  0:20   ` Thomas Monjalon
2021-04-19 13:09     ` Bruce Richardson
2021-04-19 13:47       ` Thomas Monjalon
2021-04-19 14:23         ` Bruce Richardson
2021-04-20 10:22 ` [dpdk-dev] [PATCH v2 00/16] " Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 01/16] build: simplify library build file Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 02/16] build: tidy up list of libraries to build Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 03/16] build: simplify the driver build configuration file Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 04/16] build: clean up driver lists Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 05/16] build: reduce indentation in app build spec Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 06/16] build: reduce indentation in examples " Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 07/16] build: change infrastructure file tabs to spaces Bruce Richardson
2021-04-27 19:16     ` David Christensen
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 08/16] lib: cleanup whitespace in meson build files Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 09/16] drivers: change meson file tabs to spaces Bruce Richardson
2021-04-21  1:48     ` Xu, Rosen
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 10/16] examples: " Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 11/16] app: " Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 12/16] editorconfig: add entry for meson files Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 13/16] doc: add meson coding style section to contributors guide Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 14/16] lib: remove librte_ prefix from directory names Bruce Richardson
2021-04-28 20:18     ` David Christensen
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 15/16] devtools: add script to ease backport of renamed files Bruce Richardson
2021-04-20 10:22   ` [dpdk-dev] [PATCH v2 16/16] lib: allow disabling optional libraries Bruce Richardson
2021-04-21 12:08   ` [dpdk-dev] [PATCH v2 00/16] Build file updates Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210401115009.1063844-8-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=bluca@debian.org \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).