Set PYTHONWARNINGS to error by default for --enable-werror

Setting it in environment overrides this setting.
The rationale is to avoid introducing warnings like these appeared recently:

    zipfile.py:1517: UserWarning: Duplicate name: 'cmd/ar/sc_bulletsandnumberingdialog.png'

(see e.g. https://ci.libreoffice.org/job/gerrit_windows/71910/consoleFull)

Change-Id: I8ae42e039ec3d028c01dbc4bcf422feae9e46271
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100268
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2020-08-06 20:52:01 +03:00
parent 485a8a8f21
commit 315919306c
3 changed files with 6 additions and 1 deletions

View file

@ -499,6 +499,7 @@ export PYTHON_LIBS=$(gb_SPACE)@PYTHON_LIBS@
export PYTHON_VERSION=@PYTHON_VERSION@
export PYTHON_VERSION_MAJOR=@PYTHON_VERSION_MAJOR@
export PYTHON_VERSION_MINOR=@PYTHON_VERSION_MINOR@
export PYTHONWARNINGS=@PYTHONWARNINGS@
export QRCODEGEN_CFLAGS=$(gb_SPACE)@QRCODEGEN_CFLAGS@
export QRCODEGEN_LIBS=$(gb_SPACE)@QRCODEGEN_LIBS@
export QT5_CFLAGS=$(gb_SPACE)@QT5_CFLAGS@

View file

@ -5136,16 +5136,19 @@ dnl ===================================================================
AC_MSG_CHECKING([whether to turn warnings to errors])
if test -n "$enable_werror" -a "$enable_werror" != "no"; then
ENABLE_WERROR="TRUE"
PYTHONWARNINGS="error"
AC_MSG_RESULT([yes])
else
if test -n "$LODE_HOME" -a -z "$enable_werror"; then
ENABLE_WERROR="TRUE"
PYTHONWARNINGS="error"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
AC_SUBST(ENABLE_WERROR)
AC_SUBST(PYTHONWARNINGS)
dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
dnl ===================================================================

View file

@ -21,7 +21,7 @@ ifeq ($(OS),WNT)
$(call gb_ExternalProject_get_state_target,icu,build) :
$(call gb_Trace_StartRange,icu,EXTERNAL)
$(call gb_ExternalProject_run,build,\
export LIB="$(ILIB)" \
export LIB="$(ILIB)" PYTHONWARNINGS="default" \
&& CFLAGS="-FS $(SOLARINC) $(gb_DEBUGINFO_FLAGS)" CPPFLAGS="$(SOLARINC)" CXXFLAGS="-FS $(SOLARINC) $(gb_DEBUGINFO_FLAGS)" \
INSTALL=`cygpath -m /usr/bin/install` \
./runConfigureICU \
@ -65,6 +65,7 @@ $(call gb_ExternalProject_get_state_target,icu,build) :
$(call gb_ExternalProject_run,build,\
CPPFLAGS=$(icu_CPPFLAGS) CFLAGS=$(icu_CFLAGS) \
CXXFLAGS=$(icu_CXXFLAGS) LDFLAGS=$(icu_LDFLAGS) \
PYTHONWARNINGS="default" \
./configure \
--disable-layout --disable-samples \
$(if $(filter FUZZERS,$(BUILD_TYPE)),--disable-release) \