[librsvg/librsvg-2-40] Visual Studio builds: Support Visual Studio 2017



commit 4971d06a7416cb5f73f948f738091353b490f5ad
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Mar 3 17:44:31 2017 +0800

    Visual Studio builds: Support Visual Studio 2017
    
    This adds Visual Studio 2017 support for the 2.40.x series by updating the
    autotools scripts that copy the 2010 projects and updating the items in
    there as needed.  Since Visual Studio 2017 has a different toolset version
    string format, a custom toolset version string is allowed and used if one
    is specified, otherwise it will be generated as it is before.
    
    Since Visual Studio 2017 aims to be compatible with Visual Studio 2015 on
    the CRT level, one should be able to use 2017-built binaries with
    2015-built binaries.

 build/Makefile-newvs.am      |   20 ++++++++++++++------
 build/Makefile.msvcproj      |   13 +++++++++++--
 build/win32/Makefile.am      |    3 ++-
 build/win32/vs10/Makefile.am |    6 +++++-
 build/win32/vs15/Makefile.am |   25 +++++++++++++++++++++++++
 configure.ac                 |    7 +++++++
 6 files changed, 64 insertions(+), 10 deletions(-)
---
diff --git a/build/Makefile-newvs.am b/build/Makefile-newvs.am
index 97b2459..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,12 +33,12 @@
 
 %.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:
+%.props: $(top_builddir)/build/win32/vs10/Makefile
        if test -e $(top_srcdir)/build/win32/vs10/$@; then \
                sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/build/win32/vs10/$@ 
$(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
        else \
diff --git a/build/Makefile.msvcproj b/build/Makefile.msvcproj
index 9449a5b..166d1d2 100644
--- a/build/Makefile.msvcproj
+++ b/build/Makefile.msvcproj
@@ -60,10 +60,19 @@ $(1).sourcefiles: $(top_builddir)/build/win32/vs9/$(1).vcproj
 $(1).vs10.sourcefiles: $(top_builddir)/build/win32/vs9/$(1).vcproj
 $(1).vs10.sourcefiles.filters: $(top_builddir)/build/win32/vs9/$(1).vcproj
 
-$(top_builddir)/build/win32/vs9/$(1).vcproj:
+$(top_builddir)/build/win32/vs9/$(1).vcproj: Makefile
        -$(RM) $(top_builddir)/build/win32/vs9/$(1).vcproj
        -$(RM) $(top_builddir)/build/win32/vs10/$(1).vcxproj
        -$(RM) $(top_builddir)/build/win32/vs10/$(1).vcxproj.filters
+       -$(RM) $(top_builddir)/build/win32/vs11/$(1).vcxproj
+       -$(RM) $(top_builddir)/build/win32/vs11/$(1).vcxproj.filters
+       -$(RM) $(top_builddir)/build/win32/vs12/$(1).vcxproj
+       -$(RM) $(top_builddir)/build/win32/vs12/$(1).vcxproj.filters
+       -$(RM) $(top_builddir)/build/win32/vs14/$(1).vcxproj
+       -$(RM) $(top_builddir)/build/win32/vs14/$(1).vcxproj.filters
+       -$(RM) $(top_builddir)/build/win32/vs15/$(1).vcxproj
+       -$(RM) $(top_builddir)/build/win32/vs15/$(1).vcxproj.filters
+
 
        for F in $(_proj_files); do \
                case $$$$F in \
@@ -87,7 +96,7 @@ $(top_builddir)/build/win32/vs9/$(1).vcproj:
 
 $(top_builddir)/build/win32/vs10/$(1).vs10.headers: $(top_builddir)/build/win32/vs9/$(1).headers
 
-$(top_builddir)/build/win32/vs9/$(1).headers:
+$(top_builddir)/build/win32/vs9/$(1).headers: Makefile
        -$(RM) $(top_builddir)/build/win32/vs9/$(1).headers
        -$(RM) $(top_builddir)/build/win32/vs10/$(1).vs10.headers
 
diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am
index 37b1e23..0d16812 100644
--- a/build/win32/Makefile.am
+++ b/build/win32/Makefile.am
@@ -3,7 +3,8 @@ SUBDIRS = \
        vs10    \
        vs11    \
        vs12    \
-       vs14
+       vs14    \
+       vs15
 
 if HAVE_INTROSPECTION
 GENERATED_ITEMS = \
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am
index 0295b7c..edbc440 100644
--- a/build/win32/vs10/Makefile.am
+++ b/build/win32/vs10/Makefile.am
@@ -25,8 +25,12 @@ EXTRA_DIST = \
        $(GENERATED_ITEMS)
 
 rsvg-install.props: $(top_srcdir)/build/win32/vs10/rsvg-install.propsin rsvg.vs10.headers
+       -$(RM) $(top_builddir)/build/win32/vs11/rsvg-install.props
+       -$(RM) $(top_builddir)/build/win32/vs12/rsvg-install.props
+       -$(RM) $(top_builddir)/build/win32/vs14/rsvg-install.props
+       -$(RM) $(top_builddir)/build/win32/vs15/rsvg-install.props
        $(CPP) -P - <$(top_srcdir)/build/win32/vs10/rsvg-install.propsin >$@
-       rm rsvg.vs10.headers
+       $(RM) rsvg.vs10.headers
 
 math.h: $(top_srcdir)/build/win32/vs9/math.h
        cp $< $@
diff --git a/build/win32/vs15/Makefile.am b/build/win32/vs15/Makefile.am
new file mode 100644
index 0000000..028470c
--- /dev/null
+++ b/build/win32/vs15/Makefile.am
@@ -0,0 +1,25 @@
+EXTRA_DIST =    \
+       librsvg.sln                             \
+       rsvg-build-defines.props                \
+       rsvg-gen-srcs.props                     \
+       rsvg-install.props                      \
+       rsvg-version-paths.props                \
+       libpixbufloader-svg.vcxproj             \
+       libpixbufloader-svg.vcxproj.filters     \
+       rsvg.vcxproj                            \
+       rsvg.vcxproj.filters                    \
+       rsvg-convert.vcxproj                    \
+       rsvg-convert.vcxproj.filters            \
+       rsvg-install.vcxproj                    \
+       rsvg-view-3.vcxproj                     \
+       rsvg-view-3.vcxproj.filters             \
+       README.txt 
+
+DISTCLEANFILES = $(EXTRA_DIST)
+
+MSVC_VER = 14
+MSVC_FORMAT_VER = 12
+MSVC_VER_LONG = 14
+MSVC_TOOLSET = 141
+
+include $(top_srcdir)/build/Makefile-newvs.am
diff --git a/configure.ac b/configure.ac
index f684a0f..8f275cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,6 +260,12 @@ GLIB_LC_MESSAGES
 
 dnl ===========================================================================
 
+# 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])
+
+dnl ===========================================================================
+
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([AM_CFLAGS])
 AC_SUBST([AM_LDFLAGS])
@@ -281,6 +287,7 @@ build/win32/vs10/Makefile
 build/win32/vs11/Makefile
 build/win32/vs12/Makefile
 build/win32/vs14/Makefile
+build/win32/vs15/Makefile
 ])
 
 AC_CONFIG_FILES([librsvg-${RSVG_API_VERSION}.pc:librsvg.pc.in],[],[RSVG_API_VERSION=$RSVG_API_VERSION])


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