문제

I'm porting some .NET code to mono, which involves #if blocks like:

#if !MONO
// Stuff that only works in >NET
#endif

I can define these things in the csproj file and set a mono build target. However, I was wondering if xbuild or gmcs predefined anything so I know if I'm compiling on mono.

도움이 되었습니까?

해결책

Short answer: no. There's no default flag.

For gmcs, use gmcs -d:MONO. If you build using xbuild, you can set the flag in the .csproj.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top