[libsoup] Visual Studio builds: Add support for Visual Studio 2017



commit fd568bd0fe962e05f82163a5a914b3d7d9ef176d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Feb 23 17:23:36 2017 +0800

    Visual Studio builds: Add support for Visual Studio 2017
    
    Add Visual Studio 2017 projects by updating the scripts which copies and
    updates as needed the Visual Studio 2010 projects.
    
    Note that as the toolset version string format has changed for Visual
    Studio 2017, allow a custom toolset version string and use it when
    specified, otherwise generate the toolset version string as we did
    before.
    
    Note also since Visual Studio 2017 aims to be compatible with Visual Studio
    2015 on the CRT level, there should not be problems using 2017-built binaries
    with 2015-built ones.

 build/Makefile-newvs.am        |   18 +++++++++++++-----
 build/win32/Makefile.am        |    2 +-
 build/win32/detectenv-msvc.mak |    4 +++-
 build/win32/vs15/Makefile.am   |   27 +++++++++++++++++++++++++++
 configure.ac                   |    8 ++++++++
 5 files changed, 52 insertions(+), 7 deletions(-)
---
diff --git a/build/Makefile-newvs.am b/build/Makefile-newvs.am
index b5e3216..c36de59 100644
--- a/build/Makefile-newvs.am
+++ b/build/Makefile-newvs.am
@@ -9,9 +9,17 @@
 # Author: Fan, Chun-wei
 # November 05, 2012
 
-# MSVC_VER_LONG: Long Version of Visual Studio (2012, 2013, 14 and so on)
-# MSVC_VER: Short Version of Visual Studio (11 for 2012, 12 for 2013, 14 for 2015 and so on)
-# MSVC_FORMAT_VER: Use 12 for MSVC 2012 through 2015
+# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14, 15  and so on)
+# MSVC_VER: Short Version of target Visual Studio (11 for 2012, 12 for 2013, 14 for 2015, 15 for 2017)
+# MSVC_TOOLSET: Use if target MSVC toolset is not in the form v$(MSVC_VER)0, meaning v$(MSVC_TOOLSET)
+
+if MSVC_BASE_NO_TOOLSET_SET
+MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0
+endif
+
+if MSVC_NO_TOOLSET_SET
+MSVC_TOOLSET = $(MSVC_VER)0
+endif
 
 %.sln:
        sed 's/11\.00/$(MSVC_FORMAT_VER)\.00/g' < $(top_srcdir)/build/win32/vs10/$@ > 
$(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
@@ -25,9 +33,9 @@
 
 %.vcxproj:
        if test -e $(top_srcdir)/build/win32/vs10/$@; then \
-               sed 's/v100/v$(MSVC_VER)0/g' < $(top_srcdir)/build/win32/vs10/$@ > 
$(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
+               sed 's/v100/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/build/win32/vs10/$@ > 
$(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
        else \
-               sed 's/v100/v$(MSVC_VER)0/g' < $(top_builddir)/build/win32/vs10/$@ > 
$(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
+               sed 's/v100/v$(MSVC_TOOLSET)/g' < $(top_builddir)/build/win32/vs10/$@ > 
$(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
        fi
 
 %.props: $(top_builddir)/build/win32/vs10/Makefile
diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am
index f71fcb3..794530a 100644
--- a/build/win32/Makefile.am
+++ b/build/win32/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = vs9 vs10 vs11 vs12 vs14
+SUBDIRS = vs9 vs10 vs11 vs12 vs14 vs15
 
 if HAVE_INTROSPECTION
 GENERATED_ITEMS =              \
diff --git a/build/win32/detectenv-msvc.mak b/build/win32/detectenv-msvc.mak
index 61f979d..6fd96cc 100644
--- a/build/win32/detectenv-msvc.mak
+++ b/build/win32/detectenv-msvc.mak
@@ -40,8 +40,10 @@ VSVER = 10
 VSVER = 11
 !elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
 VSVER = 12
-!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
+!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 1910
 VSVER = 14
+!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 2000
+VSVER = 15
 !else
 VSVER = 0
 !endif
diff --git a/build/win32/vs15/Makefile.am b/build/win32/vs15/Makefile.am
new file mode 100644
index 0000000..f9115ed
--- /dev/null
+++ b/build/win32/vs15/Makefile.am
@@ -0,0 +1,27 @@
+EXTRA_DIST = \
+       libsoup.sln                     \
+       get.vcxproj                     \
+       simple-httpd.vcxproj            \
+       simple-proxy.vcxproj            \
+       get.vcxproj.filters             \
+       soup-install.vcxproj            \
+       simple-httpd.vcxproj.filters    \
+       simple-proxy.vcxproj.filters    \
+       soup-build-defines.props        \
+       soup-dll-build-defines.props    \
+       soup-gen-srcs.props             \
+       soup-version-paths.props        \
+       soup.vcxproj                    \
+       soup-gnome.vcxproj              \
+       soup.vcxproj.filters            \
+       soup-gnome.vcxproj.filters      \
+       soup-install.props
+
+DISTCLEANFILES = $(EXTRA_DIST)
+
+MSVC_VER = 15
+MSVC_FORMAT_VER = 12
+MSVC_VER_LONG = 15
+MSVC_TOOLSET = 141
+
+include $(top_srcdir)/build/Makefile-newvs.am
diff --git a/configure.ac b/configure.ac
index c0a88c1..5e42831 100644
--- a/configure.ac
+++ b/configure.ac
@@ -404,6 +404,13 @@ case "$host" in
 esac
 AC_SUBST(SOUP_HIDDEN_VISIBILITY_CFLAGS)
 
+dnl ****************************************************
+dnl *** Check whether MSVC toolset is explicitly set ***
+dnl ****************************************************
+AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
+AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
+
+
 dnl *************************
 dnl *** Output Everything ***
 dnl *************************
@@ -431,5 +438,6 @@ AC_CONFIG_FILES([
        build/win32/vs11/Makefile
        build/win32/vs12/Makefile
        build/win32/vs14/Makefile
+       build/win32/vs15/Makefile
        ])
 AC_OUTPUT


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]