编译器#if指令可在Mono和.NET之间拆分 [英] Compiler #if directive to split between Mono and .NET

查看:77
本文介绍了编译器#if指令可在Mono和.NET之间拆分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要双重编译Mac上的Mono和PC上的.NET的类库.我想进行一些小的更改,但是我希望使用编译器指令来拆分代码.有什么建议吗?

I need to dual-compile a class library for Mono on the Mac and .NET on the PC. There are some minor changes I want to make, but I was hoping to split the code using a compiler directive. Any suggestions?

推荐答案

当然可以使用

#if MONO

然后用

gmcs -define:MONO ...

(当然,也可以将其放入您的Mono构建配置中.这实际上取决于您如何构建库.)

(Or put it in your Mono build configuration, of course. It really depends on how you're building your library.)

...您还在寻找什么?

... what are you looking for beyond that?

这篇关于编译器#if指令可在Mono和.NET之间拆分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆