[json-glib] Visual Studio builds: Support Visual Studio 2017



commit 2b3590a6389ba5085d671baae64c79b7f5d880f2
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Feb 24 16:31:54 2017 +0800

    Visual Studio builds: Support Visual Studio 2017
    
    Support Visual Studio 2017 by updating the scripts that copy the 2010
    projects and updates items as neccessary to produce the 2017 projects.
    
    Please note that since the toolset version string for Visual Studio 2017
    changed, a custom toolset version string is allowed and used if specified,
    otherwise a toolset version string is generated as it were before.
    
    Note also that Visual Studio 2017 aims to be compatible with 2015 on the
    CRT level, so there should not be problems using 2017-built binaries with
    2015-built binaries.

 build/Makefile-newvs.am        |   18 +++++++++---
 build/win32/Makefile.am        |    2 +-
 build/win32/detectenv-msvc.mak |    4 ++-
 build/win32/vs10/Makefile.am   |    1 +
 build/win32/vs15/Makefile.am   |   54 ++++++++++++++++++++++++++++++++++++++++
 configure.ac                   |    5 +++
 6 files changed, 77 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 ae561b3..dcb52b7 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/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 1727dc6..60fbe74 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -9,6 +9,7 @@ json-glib-install.props: $(top_srcdir)/build/win32/vs10/json-glib-install.propsi
        -$(RM) $(top_builddir)/build/win32/vs11/json-glib-install.props
        -$(RM) $(top_builddir)/build/win32/vs12/json-glib-install.props
        -$(RM) $(top_builddir)/build/win32/vs14/json-glib-install.props
+       -$(RM) $(top_builddir)/build/win32/vs15/json-glib-install.props
        $(CPP) -P - <$(top_srcdir)/build/win32/vs10/json-glib-install.propsin >$@
        rm json-glib.vs10.headers
 
diff --git a/build/win32/vs15/Makefile.am b/build/win32/vs15/Makefile.am
new file mode 100644
index 0000000..d5a2bd7
--- /dev/null
+++ b/build/win32/vs15/Makefile.am
@@ -0,0 +1,54 @@
+NULL =
+
+EXTRA_DIST =   \
+       json-glib.sln                   \
+       json-glib-version-paths.props   \
+       json-glib-build-defines.props   \
+       json-glib-gen-srcs.props        \
+       json-glib-install.props \
+       json-glib.vcxproj               \
+       json-glib.vcxproj.filters       \
+       json-glib-format.vcxproj                \
+       json-glib-format.vcxproj.filters        \
+       json-glib-validate.vcxproj              \
+       json-glib-validate.vcxproj.filters      \
+       array.vcxproj           \
+       array.vcxproj.filters   \
+       boxed.vcxproj   \
+       boxed.vcxproj.filters   \
+       builder.vcxproj         \
+       builder.vcxproj.filters \
+       generator.vcxproj               \
+       generator.vcxproj.filters       \
+       gvariant.vcxproj                \
+       gvariant.vcxproj.filters        \
+       json-glib-install.vcxproj       \
+       node.vcxproj            \
+       node.vcxproj.filters    \
+       object.vcxproj          \
+       object.vcxproj.filters  \
+       parser.vcxproj          \
+       parser.vcxproj.filters  \
+       path.vcxproj            \
+       path.vcxproj.filters    \
+       reader.vcxproj          \
+       reader.vcxproj.filters  \
+       serialize-complex.vcxproj       \
+       serialize-complex.vcxproj.filters       \
+       serialize-full.vcxproj  \
+       serialize-full.vcxproj.filters  \
+       serialize-simple.vcxproj        \
+       serialize-simple.vcxproj.filters        \
+       README.txt      \
+       invalid.vcxproj \
+       invalid.vcxproj.filters \
+       $(NULL)
+
+MSVC_VER = 15
+MSVC_FORMAT_VER = 12
+MSVC_VER_LONG = 15
+MSVC_TOOLSET = 141
+
+DISTCLEANFILES = $(EXTRA_DIST)
+
+include $(top_srcdir)/build/Makefile-newvs.am
diff --git a/configure.ac b/configure.ac
index be0a788..718a249 100644
--- a/configure.ac
+++ b/configure.ac
@@ -361,6 +361,10 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
                    [The prefix for our gettext translation domains.])
 AS_ALL_LINGUAS
 
+dnl === MSVC toolset ==========================================================
+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 === Output ================================================================
 
 AC_SUBST(JSON_CFLAGS)
@@ -378,6 +382,7 @@ AC_CONFIG_FILES([
         build/win32/vs11/Makefile
         build/win32/vs12/Makefile
         build/win32/vs14/Makefile
+        build/win32/vs15/Makefile
 
         json-glib/Makefile
         json-glib/json-glib.pc


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