[1/3] devtools/test-meson-builds: skip missing compilers
Checks
Commit Message
if either gcc or clang are missing, skip doing those builds.
This allows a setup to only do, e.g. gcc tests.
CC: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
devtools/test-meson-builds.sh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Comments
10/04/2019 22:52, Bruce Richardson:
> if either gcc or clang are missing, skip doing those builds.
> This allows a setup to only do, e.g. gcc tests.
>
> CC: stable@dpdk.org
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> # shared and static linked builds with gcc and clang
> for c in gcc clang ; do
> - for s in static shared ; do
> - export CC="ccache $c"
> - build build-$c-$s --default-library=$s
> - done
> + if command -v $c >/dev/null 2>&1 ; then
> + for s in static shared ; do
> + export CC="ccache $c"
> + build build-$c-$s --default-library=$s
> + done
> + fi
May I suggest this oneline change instead?
command -v $c >/dev/null 2>&1 || continue
On Wed, Apr 17, 2019 at 04:59:53PM +0200, Thomas Monjalon wrote:
> 10/04/2019 22:52, Bruce Richardson:
> > if either gcc or clang are missing, skip doing those builds.
> > This allows a setup to only do, e.g. gcc tests.
> >
> > CC: stable@dpdk.org
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > --- a/devtools/test-meson-builds.sh
> > +++ b/devtools/test-meson-builds.sh
> > # shared and static linked builds with gcc and clang
> > for c in gcc clang ; do
> > - for s in static shared ; do
> > - export CC="ccache $c"
> > - build build-$c-$s --default-library=$s
> > - done
> > + if command -v $c >/dev/null 2>&1 ; then
> > + for s in static shared ; do
> > + export CC="ccache $c"
> > + build build-$c-$s --default-library=$s
> > + done
> > + fi
>
> May I suggest this oneline change instead?
>
> command -v $c >/dev/null 2>&1 || continue
>
Looks fine to me. Make the change on apply if you like, otherwise let me
know if you want a V2.
@@ -54,10 +54,12 @@ fi
# shared and static linked builds with gcc and clang
for c in gcc clang ; do
- for s in static shared ; do
- export CC="ccache $c"
- build build-$c-$s --default-library=$s
- done
+ if command -v $c >/dev/null 2>&1 ; then
+ for s in static shared ; do
+ export CC="ccache $c"
+ build build-$c-$s --default-library=$s
+ done
+ fi
done
# test compilation with minimal x86 instruction set