After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753555 - Support Building librsvg Using Visual Studio
Support Building librsvg Using Visual Studio
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-12 10:14 UTC by Fan, Chun-wei
Modified: 2015-10-07 22:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rsvg-filter.c: Avoid VLA Usage (1.52 KB, patch)
2015-08-12 10:18 UTC, Fan, Chun-wei
committed Details | Review
librsvg-features.h.in: Fix Public Variable export/import on Windows builds (1.79 KB, patch)
2015-08-12 10:21 UTC, Fan, Chun-wei
committed Details | Review
Add a pre-configured config.h.win32.in template for Windows builds (4.37 KB, patch)
2015-08-12 10:39 UTC, Fan, Chun-wei
committed Details | Review
Build: Add Common Autotools Module for Generating Visual Studio 2008/2010 projects (5.64 KB, patch)
2015-08-12 14:13 UTC, Fan, Chun-wei
committed Details | Review
Build: Add Common Autotools Module for Generating Visual Studio 2012/2013 projects (2.38 KB, patch)
2015-08-12 14:17 UTC, Fan, Chun-wei
committed Details | Review
Add rsvg.symbols (2.50 KB, patch)
2015-08-12 14:20 UTC, Fan, Chun-wei
committed Details | Review
Build: Add MSVC 2008-2013 Project Files (113.58 KB, patch)
2015-08-12 14:23 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2015-08-12 10:14:22 UTC
Hi,

As it was some time that GTK+ uses the Adwaita theme, which in turn uses the adwaita-icon-theme package for its icons, I am filing this bug so that one is able to build librsvg with Visual Studio, so that applications using more recent GTK+-3.x can run properly with its icons, as some of the icons used in the Adwaita theme are in SVG format.

This will include some simple patches to the current code, plus the MSVC project items and the associated autotools scripts to generate them from the project templates as needed.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2015-08-12 10:18:50 UTC
Created attachment 309129 [details] [review]
rsvg-filter.c: Avoid VLA Usage

Hi,

This updates the rsvg-filter.c so that it will not use VLAs, which is not supported under any Visual Studio versions (including 2013 and 2015), and probably never will be, as VLAs are now optional under C11.  Plus, there may also be concerns about the VLA implementation in a given C99-capable compiler, so I think it would be good if we just forgo using VLAs...
Comment 2 Fan, Chun-wei 2015-08-12 10:21:45 UTC
Created attachment 309130 [details] [review]
librsvg-features.h.in: Fix Public Variable export/import on Windows builds

Hi,

On Windows, public variables (those that are referred to via "extern" in public headers) need to be decorated with __declspec(dllexport) and __declspec(dllimport) when the library is built as a DLL, so that they can be exported, linked to and referred to properly.

This updates librsvg-features.h.in for this reason...
Comment 3 Fan, Chun-wei 2015-08-12 10:39:19 UTC
Created attachment 309133 [details] [review]
Add a pre-configured config.h.win32.in template for Windows builds

Hi,

This adds a pre-configured config.h.win32.in template, which is processed during autogen/configure, where its processed result, config.h.win32, can be dist'ed with it so that Visual Studio builds can use it during the build.  This is due to the case that the Visual Studio builds do not use autotools...
Comment 4 Fan, Chun-wei 2015-08-12 14:13:39 UTC
Created attachment 309149 [details] [review]
Build: Add Common Autotools Module for Generating Visual Studio 2008/2010 projects

Hi,

This adds a common autotools module that is used to generate the complete MSVC 2008/2010 projects from the templates, to simplify maintenance.  This is also used to generate the property sheets that is used to copy the build results and the headers...
Comment 5 Fan, Chun-wei 2015-08-12 14:17:05 UTC
Created attachment 309150 [details] [review]
Build: Add Common Autotools Module for Generating Visual Studio 2012/2013 projects

Hi,

As the MSVC 2012/2013 projects are largely similar to the 2010 ones, we can copy the 2010 ones and change the items in there as needed with a simple series of scripts, so here it is...
Comment 6 Fan, Chun-wei 2015-08-12 14:20:14 UTC
Created attachment 309152 [details] [review]
Add rsvg.symbols

Hi,

This adds a rsvg.symbols file to be used to export the public symbols (functions) from the librsvg DLL during the build.  This is done here as master is on a stable release series, but we can switch to a __declspec(dllexport) (a.k.a visibility-based export, such as what GLib, GTK+ and Clutter are now doing), when we hit the next dev cycle for librsvg...
Comment 7 Fan, Chun-wei 2015-08-12 14:23:04 UTC
Created attachment 309153 [details] [review]
Build: Add MSVC 2008-2013 Project Files

Hi,

This is the patch that uses the autotools modules to create the full set of project files that is used to build librsvg, as per the Visual Studio versions supported by GLib and GTK+.  This patch may need to be applied with --ignore-whitespace, as the .sln files must use Windows/DOS EOL to work properly, unlike any of the other files.

This is the last of my proposed patchset for this now.

With blessings, thank you!
Comment 8 Paolo Borelli 2015-09-02 10:45:51 UTC
Hi Fan, apart from the first (which is however very simple) they are all MSVC specific so I think it is ok if you just go ahead and commit since you are already the maintainer of the MSVC stuff in gtk, glib etc.

We can try to poke Federico on irc just to be sure.
Comment 9 Ignacio Casal Quinteiro (nacho) 2015-09-24 20:31:54 UTC
Fan, I would say to go ahead. I tried to reach Federico on IRC without luck, so let's just push it and if there is some problem we can always revert it, but I doubt it since the patches look good.
Comment 10 Fan, Chun-wei 2015-09-25 12:38:07 UTC
Hi Nacho,

Thanks for the go ahead...

The patches were pushed as follows:
-attachment 309129 [details] [review]: 741b8d9
-attachment 309130 [details] [review]: 8859386
-attachment 309133 [details] [review]: 8c90a81
-attachment 309152 [details] [review]: b9e55de
-attachment 309149 [details] [review]: e00205c (Modified, shares the same file with GLib, GTK+, etc)
-attachment 309150 [details] [review]: 01b4398 (Modified, with comments on reuse and accommodates VS 2015)
-attachment 309153 [details] [review]: fa3ff32 (Modified to accommodate VS 2015)

I will keep this open for a few days to see any problems should arise, or do you think I should also take a stab on doing introspection support for Visual Studio for this bug?

With blessings, thank you!
Comment 11 Ignacio Casal Quinteiro (nacho) 2015-09-25 12:40:29 UTC
Hi Fan,

about g-i I would say just close the bug and feel free to push the patches since anyway they will touch just the msvc projects.

Cheers.
Comment 12 Fan, Chun-wei 2015-10-07 13:49:12 UTC
Hi Nacho,

Thanks, will close this now.

With blessings, thank you!
Comment 13 Federico Mena Quintero 2015-10-07 22:18:55 UTC
Thanks for your great work on this, Chun-wei!  I'll do a release.