[Kde-bindings] Building "assemblies" branch of assemblygen under Windows

Dimitar Dobrev dpldobrev at yahoo.com
Thu Dec 15 15:17:59 UTC 2011


Yes, I did. Go to src/plugins/qyoto/QyotoTranslator.cs and add new Regex(@"QSysInfo::windowsVersion.*") to excludedMethods. Didn't patch it because Arno said it is a hack.



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Thursday, December 15, 2011 5:07 PM
Subject: Re: [Kde-bindings] Building "assemblies" branch of assemblygen under Windows
 

It turns out that assemblygen's usage of Microsoft.CSharp.CSharpCodeProviderdefaulted to the 2.0 runtime.  That was an easy fix to assemblygen/src/main.cs:
    Dictionary<string,string> oProvOptions = new Dictionary<string,string>();

    oProvOptions.Add ("CompilerVersion", "v3.5");
    CodeDomProvider csharp = new Microsoft.CSharp.CSharpCodeProvider(oProvOptions);


Now bin/qyoto-qtcore.cs compiles, until it reaches a legitimate error in the code: there are two definitions of WindowsVersion. One is a property, one is a function.  Here's what the generated code looks like:

  34254         public new static QSysInfo.WinVersion WindowsVersion {
  34255             get {
  34256                 return ((QSysInfo.WinVersion)(staticInterceptor.Invoke("WindowsVersion", "WindowsVersion() const", typeof(QSysInfo.WinVersion), false)));
  34257             }
  34258         }
  34259         
  34260         protected new void CreateProxy() {
  34261             this.interceptor = new
 SmokeInvocation(typeof(QSysInfo), this);
  34262         }
  34263         
  34264         [SmokeMethod("windowsVersion()")]
  34265         public static QSysInfo.WinVersion WindowsVersion() {
  34266             object[] smokeArgs = new object[0];
  34267             return ((QSysInfo.WinVersion)(staticInterceptor.Invoke("windowsVersion", "windowsVersion()", typeof(QSysInfo.WinVersion), false, smokeArgs)));
  34268         }


As you can see, line 34254 defines a property called WindowsVersion, and line 34265 defines a function called WindowsVersion.

Dimitar, did you run into this?

Steven Boswell


________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: Dimitar Dobrev <dpldobrev at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Wednesday, December 14, 2011 7:40 PM
Subject: Re: [Kde-bindings] Building "assemblies" branch of assemblygen under Windows
 

I looked at all the generated executables and DLLs with Dependency Walker; it said all of them were built for x86.  The issue is that the assemblygen executable is being built with the default value for /platform, which is "anycpu".  I hacked lines 166 and 268 of cmake/modules/CMakeCSharpInformation.cmake to add "/platform:x86" and got past this.


Now assemblygen runs, the Q_PROPERTY strings aren't garbage, and the code generated looks OK...but the C# compiler dies with what appears to be bogus errors:

[...]

_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20111215/6edb6af6/attachment.html>


More information about the Kde-bindings mailing list