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 728190 - Visual C++ builds: Eliminate the MinGW/GCC dependency for building introspection files
Visual C++ builds: Eliminate the MinGW/GCC dependency for building introspect...
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-04-14 15:33 UTC by Fan, Chun-wei
Modified: 2015-02-07 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Update scannerlexer.l to handle Visual C++-specific items (3.41 KB, patch)
2014-04-15 04:51 UTC, Fan, Chun-wei
none Details | Review
Update sourcescanner.py to support using the MSVC preprocessor (4.70 KB, patch)
2014-04-15 05:01 UTC, Fan, Chun-wei
none Details | Review
Update sourcescanner.py to support using the MSVC preprocessor (take ii) (4.75 KB, patch)
2014-04-15 07:35 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2014-04-14 15:33:05 UTC
Hi,

g-i in its current state is usable on Windows, but currently requires a suitable GCC installation (such as MinGW or mingw64) in order to run the preprocessor to generate the introspection dumper program source.  This is, as a result, not optimal, so this bug is to track the process of eliminating that dependency on building the introspection files with Visual C++ builds (but keeping things in the current shape for MinGW-based builds).

I will post patches in this bug for this purpose in the next few days.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2014-04-15 04:51:44 UTC
Created attachment 274327 [details] [review]
Update scannerlexer.l to handle Visual C++-specific items

Hi,

This updates scannerlexer.l in the following ways:

-Visual C++-specific items such as __cdecl,
 __declspec(deprecated|dllexport|dllimport|noalias|restrict),
 __stdcall, __w64 will be ignored, so that we can avoid many
 warnings and the scanner bailing out when using the Visual
 C++ preprocessor to produce the introspection dumper program
 source.  The Visual C++-specific __int64 is also handled here
 as well.

-Handle also the line markers produced by Visual C++ preprocessor,
 as it puts #line x instead of # x in front the the headers/source
 files.  This is necessary so that the _get_type and _get_gtype
 symbols can be acquired correctly from the various headers and
 sources that are passed in.
Comment 2 Fan, Chun-wei 2014-04-15 05:01:02 UTC
Created attachment 274328 [details] [review]
Update sourcescanner.py to support using the MSVC preprocessor

Hi,

This adds support to sourcescanner.py to support using the Visual C++ preprocessor, which will eliminate the need for a GCC installation to produce introspection files for Visual C++ builds of g-i.  The main thing that is done here is, on Visual C++ builds, instead of passing the "source" containing the headers to scan via stdin, we use a temp file to do the same for Visual C++ builds.

Some extra compile-time macros are also defined when we are on Visual C++, as doing so will avoid numerous warnings and the need to handle additional MSVC-specific items in scannerlexer.l.

I was able to produce identical .gir files for the glib libraries, as well as ATK, versus the ones that I had when preprocessing the sources via MinGW-GCC, with the ability to run the PyGObject 3.x demos as well as I did before.*

[*]: The Gtk-3.0.gir is slightly different, as there is the added advantage here that time_t is supported without having to define it during the build of the introspection files.

With blessings, thank you!
Comment 3 Fan, Chun-wei 2014-04-15 07:35:23 UTC
Created attachment 274332 [details] [review]
Update sourcescanner.py to support using the MSVC preprocessor (take ii)

Hi,

I updated the patch a bit on sourcescanner.py so that it will satisfy the requirements of PEP-8.

With blessings, thank you!
Comment 4 Fan, Chun-wei 2014-05-07 10:08:42 UTC
Hi,

I am closing this bug and moving the attention for this to bug 728313 as work there is closely related to this as well, so I will shift the patch for scannerlexer.l there as well.

With blessings, thank you!
Comment 5 André Klapper 2015-02-07 16:58:53 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]