config_host.mk.in | 1 + configure.ac | 23 +++++++++++++++++++++++ solenv/gbuild/platform/com_MSC_defs.mk | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-)
New commits: commit ac431b399f9fe3b772abd8fda6d0727bfa6c9135 Author: Noel Grandin <noelgran...@collabora.co.uk> AuthorDate: Wed Jul 10 10:05:37 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Jul 10 19:04:00 2024 +0200 make MSVC /analyze a configure option My debug build is slow enough already, no need to make it worse. People who want it, can turn it on explicitly. Change-Id: I8677534d8f0142699baa6b95a249ae5f70c5cc3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/config_host.mk.in b/config_host.mk.in index f5666b16aa13..4a5b6c12e843 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -149,6 +149,7 @@ export EMSCRIPTEN_EXTRA_SOFFICE_POST_JS=@EMSCRIPTEN_EXTRA_SOFFICE_POST_JS@ export ENABLE_ANDROID_LOK=@ENABLE_ANDROID_LOK@ export ENABLE_ANDROID_EDITING=@ENABLE_ANDROID_EDITING@ export ENABLE_AVAHI=@ENABLE_AVAHI@ +export ENABLE_MSVC_ANALYZE=@ENABLE_MSVC_ANALYZE@ export ENABLE_BREAKPAD=@ENABLE_BREAKPAD@ export DEFAULT_CRASHDUMP_VALUE=@DEFAULT_CRASHDUMP_VALUE@ export ENABLE_CAIRO_CANVAS=@ENABLE_CAIRO_CANVAS@ diff --git a/configure.ac b/configure.ac index 9a6ccc030608..9dcee9af0251 100644 --- a/configure.ac +++ b/configure.ac @@ -1646,6 +1646,11 @@ AC_ARG_ENABLE(avahi, [Determines whether to use Avahi to advertise Impress to remote controls.]) ) +AC_ARG_ENABLE(msvc-analyze, + AS_HELP_STRING([--enable-msvc-analyze], + [Determines whether to enable the Microsoft Visual Studio /analyze flag to provide additional warnings.]) +) + libo_FUZZ_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], [Turn warnings to errors. (Has no effect in modules where the treating @@ -14168,6 +14173,24 @@ AC_SUBST(ENABLE_AVAHI) AC_SUBST(AVAHI_CFLAGS) AC_SUBST(AVAHI_LIBS) +dnl =================================================================== +dnl Test whether to use MSVC /analyze +dnl =================================================================== +ENABLE_MSVC_ANALYZE= +AC_MSG_CHECKING([whether to use MSVC /analyze]) +if test -n "$enable_msvc_analyze" -a "$enable_msvc_analyze" != "no"; then +if test "$_os" = "WINNT"; then + ENABLE_MSVC_ANALYZE=Yes + AC_MSG_RESULT([yes]) +else + AC_MSG_ERROR([--enable-msvc-analyze is only supported on Windows]) +fi +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(ENABLE_MSVC_ANALYZE) + dnl =================================================================== dnl Test whether to use liblangtag dnl =================================================================== diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index 4c6a7e25a885..36ce2b1f964b 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -104,7 +104,7 @@ gb_AFLAGS := $(AFLAGS) # C4706: assignment within conditional expression # build-time penalty is too high for ci use/disable when JENKINS_HOME is set -MSVC_ANALYZE_FLAGS := $(if $(JENKINS_HOME),,-analyze:ruleset$(SRCDIR)/solenv/vs/LibreOffice.ruleset) +MSVC_ANALYZE_FLAGS := $(if $(ENABLE_MSVC_ANALYZE),-analyze:ruleset$(SRCDIR)/solenv/vs/LibreOffice.ruleset,) gb_FilterOutClangCFLAGS += $(MSVC_ANALYZE_FLAGS)