[gtksourceview/gnome-3-24] Visual Studio builds: Add support for Visual Studio 2017



commit 5e77721605c135692190c91ccc2ef4978e2d0ede
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Feb 17 15:47:42 2017 +0800

    Visual Studio builds: Add support for Visual Studio 2017
    
    This adds support for Visual Studio 2017 by updating the autotools
    scripts to copy the 2010 projects and updating items as necessary to
    obtain the 2017 projects.
    
    Note that the toolset version string format changed for Visual Studio
    2017, so a custom toolset version string is allowed and used if
    specified, otherwise it will be generated as it were before.
    
    Note also that Visual Studio 2017 aims to be compatible with Visual Studio
    2015 on the CRT level, so 2017-built binaries should work with 2015-built
    binaries without problems.

 configure.ac            |    6 ++++++
 win32/Makefile-newvs.am |   16 +++++++++++++---
 win32/Makefile.am       |    3 ++-
 win32/vs10/Makefile.am  |    1 +
 win32/vs15/Makefile.am  |   21 +++++++++++++++++++++
 5 files changed, 43 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a1f8fb8..e8b0daa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,6 +224,11 @@ VAPIGEN_CHECK
 ABS_TOP_SRCDIR=`cd $srcdir && pwd`
 AC_SUBST(ABS_TOP_SRCDIR)
 
+# Check whether MSVC toolset is explicitly set
+
+AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
+AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
+
 # Output files
 AC_CONFIG_FILES([
 gtksourceview-${GSV_API_VERSION}.pc:gtksourceview.pc.in
@@ -237,6 +242,7 @@ win32/vs10/gtksourceview-gen-srcs.props
 win32/vs11/Makefile
 win32/vs12/Makefile
 win32/vs14/Makefile
+win32/vs15/Makefile
 data/Makefile
 data/glade/Makefile
 data/glade/gtksourceview.xml
diff --git a/win32/Makefile-newvs.am b/win32/Makefile-newvs.am
index 25feb39..c7b64df 100644
--- a/win32/Makefile-newvs.am
+++ b/win32/Makefile-newvs.am
@@ -10,8 +10,18 @@
 
 # MSVC_BASE_VER: Baseline MSVC 201x version to copy/process project files from (10 for 2010, 12 for 2013)
 # MSVC_BASE_VER_LONG: Long Version of baseline Visual Studio 201x version (2010, 2012, 2013, 14, 15)
+# MSVC_BASE_TOOLSET: Use if baseline MSVC toolset is not in the form v$(MSVC_BASE_VER)0, meaning 
v$(MSVC_BASE_TOOLSET)
 # MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on)
-# MSVC_VER: Short Version of target Visual Studio (11 for 2012, 12 for 2013, 14 for 2015)
+# 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 of $(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/12\.00/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > 
$(top_builddir)/win32/vs$(MSVC_VER)/$@.tmp
@@ -25,9 +35,9 @@
 
 %.vcxproj:
        if test -e $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@; then \
-               sed 's/v$(MSVC_BASE_VER)0/v$(MSVC_VER)0/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ > 
$(top_builddir)/win32/vs$(MSVC_VER)/$@; \
+               sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/win32/vs$(MSVC_BASE_VER)/$@ 
$(top_builddir)/win32/vs$(MSVC_VER)/$@; \
        else \
-               sed 's/v$(MSVC_BASE_VER)0/v$(MSVC_VER)0/g' < $(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > 
$(top_builddir)/win32/vs$(MSVC_VER)/$@; \
+               sed 's/v$(MSVC_BASE_TOOLSET)/v$(MSVC_TOOLSET)/g' < 
$(top_builddir)/win32/vs$(MSVC_BASE_VER)/$@ > $(top_builddir)/win32/vs$(MSVC_VER)/$@; \
        fi
 
 %.props: $(top_builddir)/win32/vs$(MSVC_BASE_VER)/Makefile
diff --git a/win32/Makefile.am b/win32/Makefile.am
index a29dce3..46dfb1e 100644
--- a/win32/Makefile.am
+++ b/win32/Makefile.am
@@ -3,7 +3,8 @@ SUBDIRS = \
        vs10    \
        vs11    \
        vs12    \
-       vs14
+       vs14    \
+       vs15
 
 GENERATED_ITEMS = gen-enums.bat
 
diff --git a/win32/vs10/Makefile.am b/win32/vs10/Makefile.am
index e69a3ec..2b180ad 100644
--- a/win32/vs10/Makefile.am
+++ b/win32/vs10/Makefile.am
@@ -22,6 +22,7 @@ gtksourceview-install.props: $(top_srcdir)/win32/vs10/gtksourceview-install.prop
        -$(RM) $(top_builddir)/win32/vs11/gtksourceview-install.props
        -$(RM) $(top_builddir)/win32/vs12/gtksourceview-install.props
        -$(RM) $(top_builddir)/win32/vs14/gtksourceview-install.props
+       -$(RM) $(top_builddir)/win32/vs15/gtksourceview-install.props
        $(CPP) -P - <$(top_srcdir)/win32/vs10/gtksourceview-install.propsin >$@
        $(RM) $(MSVC10_HEADERS_LISTS)
 
diff --git a/win32/vs15/Makefile.am b/win32/vs15/Makefile.am
new file mode 100644
index 0000000..f0ee583
--- /dev/null
+++ b/win32/vs15/Makefile.am
@@ -0,0 +1,21 @@
+EXTRA_DIST =                           \
+       gtksourceview.sln                       \
+       gtksourceview-build-defines.props       \
+       gtksourceview-gen-srcs.props            \
+       gtksourceview-install.props             \
+       gtksourceview-version-paths.props       \
+       gtksourceview.vcxproj                   \
+       gtksourceview.vcxproj.filters           \
+       gtksourceview-install.vcxproj
+
+DISTCLEANFILES = $(EXTRA_DIST)
+
+MSVC_BASE_VER = 10
+MSVC_BASE_VER_LONG = 2010
+MSVC_VER = 15
+MSVC_VER_LONG = 15
+MSVC_TOOLSET = 141
+
+include $(top_srcdir)/win32/Makefile-newvs.am
+
+-include $(top_srcdir)/git.mk


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