README.md    |    2 +-
 configure.ac |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 7fe756570fb4ab30f540d644fd5125a67c2d9ea9
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Sun Apr 24 12:04:33 2022 +0200
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Thu May 5 17:26:12 2022 +0200

    Warn if Visual Studio 2019 version is < 16.10
    
    During the compilation with Visual Studio 2019 v16.5, the dragonbox
    was failing the build, but it was OK when ugprading to the latest
    version, 16.11.
    
    It should be noted that according to the list of predfined macros in
    Visual Studio, v16.10 and v16.11 use the same value for _MSC_VER,
    which is 1929. Thus, the distinction between these 2 versions can not
    be distinguished.
    
    Predefined macros
    https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros
    
    For not having the Visual Studio version > 16.10, a warning is
    shown, and if the Visual Studio version is < 16.5, just like before,
    an error is generated.
    
    Change-Id: I6661ee5121b03ca43e1f7503b74191abcc8d6b40
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132907
    Tested-by: Jenkins
    Reviewed-by: Hossein <hoss...@libreoffice.org>

diff --git a/README.md b/README.md
index 96fde564a842..dcc33988f293 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ run and compile LibreOffice, also used by the TDF builds:
 
 * Windows:
     * Runtime: Windows 7
-    * Build: Cygwin + Visual Studio 2019 version 16.5
+    * Build: Cygwin + Visual Studio 2019 version 16.10
 * macOS:
     * Runtime: 10.13
     * Build: 11.0 + Xcode 12.5
diff --git a/configure.ac b/configure.ac
index ec9175d1964a..c711d230f0d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4266,6 +4266,7 @@ if test "$_os" = "WINNT"; then
         AC_MSG_ERROR([Visual C++ not found after all, huh])
     fi
 
+    # ERROR if VS version < 16.5
     AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.5])
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
         // See 
<https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for 
mapping
@@ -4275,6 +4276,21 @@ if test "$_os" = "WINNT"; then
         #endif
     ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
 
+    # WARN if VS version < 16.10
+    AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.10])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+        #if _MSC_VER < 1929
+        #error
+        #endif
+    ]])],[vs2019_recommended_version=yes],[vs2019_recommended_version=no])
+
+    if test $vs2019_recommended_version = yes; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_WARN([no])
+        add_warning "You should have at least Visual Studio 2019 version 16.10 
to avoid build problems. Otherwise, you may face problems with the build of 
some modules including dragonbox."
+    fi
+
     # Check for 64-bit (cross-)compiler to use to build the 64-bit
     # version of the Explorer extension (and maybe other small
     # bits, too) needed when installing a 32-bit LibreOffice on a

Reply via email to