[1/2] examples: strip directory and use suffix as name

Message ID 20190523174018.2873-1-alialnu@mellanox.com (mailing list archive)
State Accepted, archived
Headers
Series [1/2] examples: strip directory and use suffix as name |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Ali Alnubani May 23, 2019, 5:40 p.m. UTC
  This would allow correctly naming an application residing
in a subdirectory. For example, if the example is set to 'path/to/app',
then the name would be 'app'.
This doesn't affect the naming of an example that isn't in a subdirectory.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
---
 examples/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Luca Boccassi May 23, 2019, 6:42 p.m. UTC | #1
On Thu, 2019-05-23 at 17:40 +0000, Ali Alnubani wrote:
> This would allow correctly naming an application residing
> in a subdirectory. For example, if the example is set to
> 'path/to/app',
> then the name would be 'app'.
> This doesn't affect the naming of an example that isn't in a
> subdirectory.
> 
> Signed-off-by: Ali Alnubani <
> alialnu@mellanox.com
> >
> ---
>  examples/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/meson.build b/examples/meson.build
> index de35656d4..53a786eb4 100644
> --- a/examples/meson.build
> +++ b/examples/meson.build
> @@ -64,7 +64,7 @@ endif
>  default_cflags += '-D_GNU_SOURCE'
>  
>  foreach example: examples
> -	name = example
> +	name = example.split('/')[-1]
>  	build = true
>  	sources = []
>  	allow_experimental_apis = false
> -- 
> 2.19.2

Acked-by: Luca Boccassi <bluca@debian.org>
  

Patch

diff --git a/examples/meson.build b/examples/meson.build
index de35656d4..53a786eb4 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -64,7 +64,7 @@  endif
 default_cflags += '-D_GNU_SOURCE'
 
 foreach example: examples
-	name = example
+	name = example.split('/')[-1]
 	build = true
 	sources = []
 	allow_experimental_apis = false