[Gtk-sharp-list] Directive of compilation

Rafael Teixeira monoman at gmail.com
Wed Jul 20 16:25:31 EDT 2005


Wrong question: Are you compiling different code for each platform?
You should try to keep the code the same for both of them.

Some limited runtime-checking is available but during compilation you
need to define your symbols in the makefile differently for each
target.


Portuguese: Mas se você quer mesmo seguir no caminho não recomendado...

Alas,

---Makefile

all: linux windows

windows:
     mcs -d:MYWINDOWSAPP myapp.cs -t:exe -out:myapp.windows.exe

linux:
     mcs myapp.cs -t:exe -out:myapp.linux.exe


and on myapp.cs

---myapp.cs
#ifdef MYWINDOWSAPP
// some windows only code
#else
// some non-windows only code
#endif

On 7/19/05, Paulinho <amf.paulo at gmail.com> wrote:
> Hi Simios,
> 
> How to put directive of compilation in my C# program ? I need to verify
> if it is Windows or Linux....
> 
> 
> Thanks
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 


-- 
Rafael "Monoman" Teixeira
---------------------------------------
I'm trying to become a "Rosh Gadol" before my own eyes. 
See http://www.joelonsoftware.com/items/2004/12/06.html for enlightment.
It hurts!


More information about the Gtk-sharp-list mailing list