build: replace meson OS detection with variable
diff mbox series

Message ID 20200629203656.39052-1-thomas@monjalon.net
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series
  • build: replace meson OS detection with variable
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Thomas Monjalon June 29, 2020, 8:36 p.m. UTC
Some places were calling the meson function host_machine.system()
instead of the variables is_windows and is_linux defined
in config/meson.build.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 buildtools/pmdinfogen/meson.build    | 2 +-
 drivers/crypto/octeontx2/meson.build | 2 +-
 drivers/net/pfe/meson.build          | 2 +-
 examples/ntb/meson.build             | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Comments

Bruce Richardson June 30, 2020, 12:08 p.m. UTC | #1
On Mon, Jun 29, 2020 at 10:36:56PM +0200, Thomas Monjalon wrote:
> Some places were calling the meson function host_machine.system()
> instead of the variables is_windows and is_linux defined
> in config/meson.build.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

though while changing this it would be good if you could take care of the
one additional comment below also.
> ---
>  buildtools/pmdinfogen/meson.build    | 2 +-
>  drivers/crypto/octeontx2/meson.build | 2 +-
>  drivers/net/pfe/meson.build          | 2 +-
>  examples/ntb/meson.build             | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/buildtools/pmdinfogen/meson.build b/buildtools/pmdinfogen/meson.build
> index 7da415b3b7..670528fac7 100644
> --- a/buildtools/pmdinfogen/meson.build
> +++ b/buildtools/pmdinfogen/meson.build
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2017 Intel Corporation
>  
> -if host_machine.system() == 'windows'
> +if is_windows
>  	subdir_done()
>  endif
>  
> diff --git a/drivers/crypto/octeontx2/meson.build b/drivers/crypto/octeontx2/meson.build
> index a28c700b9f..e3d34db38a 100644
> --- a/drivers/crypto/octeontx2/meson.build
> +++ b/drivers/crypto/octeontx2/meson.build
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright (C) 2019 Marvell International Ltd.
>  
> -if host_machine.system() != 'linux'
> +if not is_linux
>          build = false
>  endif
>  

This and the other instances below should also set "reason" variable so we
get in the output log at the end why they are not being built. Generally
drivers copy-paste this line:

	reason = 'only supported on Linux'

> diff --git a/drivers/net/pfe/meson.build b/drivers/net/pfe/meson.build
> index 3e1a228a3f..6d4b838eb7 100644
> --- a/drivers/net/pfe/meson.build
> +++ b/drivers/net/pfe/meson.build
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright 2019 NXP
>  
> -if host_machine.system() != 'linux'
> +if not is_linux
>  	build = false
>  endif
>  deps += ['common_dpaax']
> diff --git a/examples/ntb/meson.build b/examples/ntb/meson.build
> index ab449d0939..45a59350c5 100644
> --- a/examples/ntb/meson.build
> +++ b/examples/ntb/meson.build
> @@ -7,7 +7,7 @@
>  # DPDK instance, use 'make'
>  
>  allow_experimental_apis = true
> -if host_machine.system() != 'linux'
> +if not is_linux
>  	build = false
>  endif
>  deps += 'rawdev'
> -- 
> 2.26.2
>

Patch
diff mbox series

diff --git a/buildtools/pmdinfogen/meson.build b/buildtools/pmdinfogen/meson.build
index 7da415b3b7..670528fac7 100644
--- a/buildtools/pmdinfogen/meson.build
+++ b/buildtools/pmdinfogen/meson.build
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/drivers/crypto/octeontx2/meson.build b/drivers/crypto/octeontx2/meson.build
index a28c700b9f..e3d34db38a 100644
--- a/drivers/crypto/octeontx2/meson.build
+++ b/drivers/crypto/octeontx2/meson.build
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (C) 2019 Marvell International Ltd.
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/net/pfe/meson.build b/drivers/net/pfe/meson.build
index 3e1a228a3f..6d4b838eb7 100644
--- a/drivers/net/pfe/meson.build
+++ b/drivers/net/pfe/meson.build
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2019 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['common_dpaax']
diff --git a/examples/ntb/meson.build b/examples/ntb/meson.build
index ab449d0939..45a59350c5 100644
--- a/examples/ntb/meson.build
+++ b/examples/ntb/meson.build
@@ -7,7 +7,7 @@ 
 # DPDK instance, use 'make'
 
 allow_experimental_apis = true
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += 'rawdev'