Fix parallel build of the sample when using configure

Don't add both a directory and its subdirectories to SAMPLES_SUBDIRS as
this can result in 2 sub-makes building in the same directory in
parallel: one make process recursing into sub-subdirectory from the
subdirectory and another one running directly inside it. This notably
results in recurring failures in GitHub Actions CI builds.

We still need to create makefile.in in the subdirectories containing
other samples, so add a separate SAMPLES_SUBTREES variable and use it to
collect such directories, instead of putting them into SAMPLES_SUBDIRS
itself.
This commit is contained in:
Vadim Zeitlin
2021-02-01 10:30:36 +01:00
parent 8d1ad482b6
commit 7856a385d1
2 changed files with 20 additions and 4 deletions

10
configure vendored
View File

@@ -29103,7 +29103,8 @@ $as_echo "$as_me: WARNING: wxGLCanvas not implemented for this port, library wil
$as_echo "#define wxUSE_GLCANVAS 1" >>confdefs.h $as_echo "#define wxUSE_GLCANVAS 1" >>confdefs.h
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf opengl/pyramid" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl/cube opengl/penguin opengl/isosurf opengl/pyramid"
SAMPLES_SUBTREES="$SAMPLES_SUBTREES opengl"
fi fi
fi fi
@@ -37119,7 +37120,8 @@ if test "$wxUSE_HTML" = "yes"; then
$as_echo "#define wxUSE_HTML 1" >>confdefs.h $as_echo "#define wxUSE_HTML 1" >>confdefs.h
USE_HTML=1 USE_HTML=1
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox"
SAMPLES_SUBTREES="$SAMPLES_SUBTREES html"
fi fi
USE_XRC=0 USE_XRC=0
@@ -41306,6 +41308,10 @@ for subdir in $SUBDIRS; do
if test -d $srcdir/samples/$sample; then if test -d $srcdir/samples/$sample; then
makefiles="samples/$sample/Makefile.in $makefiles" makefiles="samples/$sample/Makefile.in $makefiles"
fi fi
done
for subtree in $SAMPLES_SUBTREES; do
makefiles="samples/$subtree/Makefile.in $makefiles"
done done
else else
disabled_var=DISABLED_`echo $subdir | tr '[a-z]' '[A-Z]'` disabled_var=DISABLED_`echo $subdir | tr '[a-z]' '[A-Z]'`

View File

@@ -3914,7 +3914,8 @@ if test "$wxUSE_OPENGL" = "yes" -o "$wxUSE_OPENGL" = "auto"; then
USE_OPENGL=1 USE_OPENGL=1
AC_DEFINE(wxUSE_OPENGL) AC_DEFINE(wxUSE_OPENGL)
AC_DEFINE(wxUSE_GLCANVAS) AC_DEFINE(wxUSE_GLCANVAS)
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf opengl/pyramid" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl/cube opengl/penguin opengl/isosurf opengl/pyramid"
SAMPLES_SUBTREES="$SAMPLES_SUBTREES opengl"
fi fi
fi fi
@@ -7391,7 +7392,8 @@ USE_HTML=0
if test "$wxUSE_HTML" = "yes"; then if test "$wxUSE_HTML" = "yes"; then
AC_DEFINE(wxUSE_HTML) AC_DEFINE(wxUSE_HTML)
USE_HTML=1 USE_HTML=1
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox"
SAMPLES_SUBTREES="$SAMPLES_SUBTREES html"
fi fi
USE_XRC=0 USE_XRC=0
@@ -8729,6 +8731,14 @@ for subdir in $SUBDIRS; do
makefiles="samples/$sample/Makefile.in $makefiles" makefiles="samples/$sample/Makefile.in $makefiles"
fi fi
done done
dnl also create makefiles for the subdirectories containing
dnl other samples that are not added to SAMPLES_SUBDIRS because
dnl we don't want to recurse into them when building everything
dnl because we still want to allow building them explicitly
for subtree in $SAMPLES_SUBTREES; do
makefiles="samples/$subtree/Makefile.in $makefiles"
done
else else
dnl assume that everything compiles for utils &c dnl assume that everything compiles for utils &c
dnl any that shouldn't be built can be added to dnl any that shouldn't be built can be added to