[Mono-dev] building for Mono under msbuild

Gustavo Guerra gmcg at acm.org
Tue Oct 11 19:56:17 EDT 2005

Hi there:

Can you please explain this arguments of gmcs?:
Best regards,
Gustavo Guerra

  "Andy Waddell" <awaddell at fnfr.com> wrote in message news:619FD34741327C47AC7FBA8DBADBF5E04C2F2A at ffex01.fnfr.com...
  I have an application that needs to run under both .NET and Mono and I came up with a pretty simple way to get MS DevStudio to build both.  I don't know how others have solved this problem, but I thought I would offer it up in case it helps someone else with the same issue.  The basic approach I took was to call the Mono compiler after the Microsoft build has already run.  Microsoft has a well known target "AfterBuild" which I have hooked to invoke gmcs with pretty much the same arguments that csc.exe takes with some minor modifications.  I put all the Mono build stuff in a file called Mono.targets, so it only take a one line addition to the standard *.csproj file to get the functionality:


    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

  Add this lineà  <Import Project="<your path>\Mono.targets" />


  This will make your build essentially a dual pass build with all the Microsoft stuff running and then the Mono compiler running with all the warnings and erros showing up in the IDE as you would expect.  The work is not complete (I don't pass all the options possible, etc), but I think it's fairly obvious how to expand it if needed.  


  I'm sure there are many other ways to skin this cat, but for a quick and dirty solution, it seems to work pretty well.  


  ToDo: invesitgate xbuild to do my Linux builds.





  Mono-devel-list mailing list
  Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051012/9e38bfac/attachment.html 

More information about the Mono-devel-list mailing list