GNOME Bugzilla – Bug 753555
Support Building librsvg Using Visual Studio
Last modified: 2015-10-07 22:18:55 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!
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...
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...
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...
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...
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...
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...
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!
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.
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.
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!
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.
Hi Nacho, Thanks, will close this now. With blessings, thank you!
Thanks for your great work on this, Chun-wei! I'll do a release.