Visual Studio builds: Support Visual Studio 2017
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 17 Feb 2017 07:06:25 +0000 (15:06 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 17 Feb 2017 07:09:16 +0000 (15:09 +0800)
Update the autotools scripts so that we can support Visual Studio 2017
by copying the 2010 projects and updating items as needed to obtain
the 2017 projects.

Note that since the toolset version string changed for Visual Studio
2017, so allow the use of a custom toolset version string, otherwise
just generate the toolset version string as we did before.

Also, note that Visual Studio 2017 aims to be compatible with 2015
on the CRT level, so there should not be any problems using 2017-compiled
binaries with 2015-compiled ones.

build/Makefile-newvs.am
build/win32/Makefile.am
build/win32/vs10/Makefile.am
build/win32/vs15/Makefile.am [new file with mode: 0644]
configure.ac

index b5e321607e0c9f6f247e6176428bfe2a759dd2a5..81611776e284522939f8868672c5c6f160aa8341 100644 (file)
@@ -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 and so on)
+# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017)
+# MSVC_TOOLSET: Use if target MSVC toolsett 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
index e1253dab6b5ba8376971b8d5e609e668a957bb1a..7ccefa0765bcde367bcdb160c71173c839cd5d5b 100644 (file)
@@ -31,7 +31,8 @@ SUBDIRS =     \
        vs10    \
        vs11    \
        vs12    \
-       vs14
+       vs14    \
+       vs15
 
 EXTRA_DIST +=  \
        detectenv-msvc.mak              \
index da077669981416109266240e42fe1e346df1f4ac..cb2b2c9e11356aa51407c2940271adba6fd22c43 100644 (file)
@@ -77,6 +77,7 @@ gtk3-install.props: $(top_srcdir)/build/win32/vs10/gtk3-install.propsin $(MSVC10
        -$(RM) $(top_builddir)/build/win32/vs11/gtk3-install.props
        -$(RM) $(top_builddir)/build/win32/vs12/gtk3-install.props
        -$(RM) $(top_builddir)/build/win32/vs14/gtk3-install.props
+       -$(RM) $(top_builddir)/build/win32/vs15/gtk3-install.props
        $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gtk3-install.propsin >$@
        rm $(MSVC10_HEADERS_LISTS)
 
diff --git a/build/win32/vs15/Makefile.am b/build/win32/vs15/Makefile.am
new file mode 100644 (file)
index 0000000..6f62580
--- /dev/null
@@ -0,0 +1,52 @@
+include $(top_srcdir)/Makefile.decl
+
+EXTRA_DIST +=  \
+       README.txt      \
+       gtk+.sln        \
+       gtk3-prebuild.vcxproj   \
+       gtk3-prebuild.vcxproj.filters   \
+       gdk3-win32.vcxproj      \
+       gdk3-win32.vcxproj.filters      \
+       gdk-3.vcxproj   \
+       gdk-3.vcxproj.filters   \
+       gtk-3.vcxproj   \
+       gtk-3.vcxproj.filters   \
+       gtk-builder-tool.vcxproj                \
+       gtk-builder-tool.vcxproj.filters        \
+       gtk-encode-symbolic-svg.vcxproj \
+       gtk-encode-symbolic-svg.vcxproj.filters \
+       gtk-query-settings.vcxproj              \
+       gtk-query-settings.vcxproj.filters      \
+       gtk-update-icon-cache.vcxproj           \
+       gtk-update-icon-cache.vcxproj.filters   \
+       gtk3-demo.vcxproj       \
+       gtk3-demo.vcxproj.filters       \
+       gtk3-demo-application.vcxproj   \
+       gtk3-demo-application.vcxproj.filters   \
+       gtk3-icon-browser.vcxproj       \
+       gtk3-icon-browser.vcxproj.filters       \
+       gailutil-3.vcxproj      \
+       gailutil-3.vcxproj.filters      \
+       gtk3-install.vcxproj    \
+       gtk3-install.vcxproj.filters    \
+       broadwayd.vcxproj       \
+       broadwayd.vcxproj.filters       \
+       gdk3-broadway.vcxproj   \
+       gdk3-broadway.vcxproj.filters   \
+       gtk3-build-defines.props        \
+       gtk3-copy-gdk-broadway.props    \
+       gtk3-gen-srcs.props     \
+       gtk3-ignore-broadway.props      \
+       gtk3-install.props      \
+       gtk3-version-paths.props
+
+DISTCLEANFILES = $(EXTRA_DIST)
+
+MSVC_VER = 15
+MSVC_VER_LONG = 15
+MSVC_TOOLSET = 141
+MSVC_FORMAT_VER = 12
+
+include $(top_srcdir)/build/Makefile-newvs.am
+
+-include $(top_srcdir)/git.mk
index e72ab77121e3b1998ef67d10f3198e4b31dd5190..837cd1fed322e182c39f59f033d0e37517551a2d 100644 (file)
@@ -1885,6 +1885,13 @@ if test "x${enable_Bsymbolic}" = "xyes" ; then
 fi
 AC_SUBST(GTK_LINK_FLAGS)
 
+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])
+
 AC_CONFIG_FILES([
 README
 INSTALL
@@ -1947,6 +1954,7 @@ build/win32/vs10/gtk3-version-paths.props
 build/win32/vs11/Makefile
 build/win32/vs12/Makefile
 build/win32/vs14/Makefile
+build/win32/vs15/Makefile
 gdk/Makefile
 gdk/broadway/Makefile
 gdk/x11/Makefile