MonoDevelop: is it possible to switch PCL's compiler?

前端 未结 2 1046
深忆病人
深忆病人 2020-12-16 01:59

We are starting a cross-platform project to be deployed to Android and iOS. Obviously, a lot of code is to be shared between the two, and some of the code relies heavily on

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 02:15

    Mono does not yet have an implementation of the actual PCL libraries. For now, it has a dummy Microsoft.Portable.CSharp.targets file that instead overrides the framework and targets to build the library against MonoTouch, Mono for Android or .NET 4.0, in that order, depending what's installed.

    It looks like there's bug in the codepath that uses the MonoTouch framework - it's using the default common targets, Microsoft.CSharp.targets, without overriding the compiler to use the MonoTouch-specific version of the C# compiler. This is necessary because Mono's C# compiler is currently framework-specific (though this is fixed in Mono 2.12, which is in alpha).

    You may be able to fix this by editing the file /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild/Microsoft/Portable/v4.0/Microsoft.Portable.CSharp.targets, finding the PropertyGroup that sets

    MonoTouch
    

    And to it, adding the lines:

    smcs
    /Developer/MonoTouch/usr/bin
    

提交回复
热议问题