开发者

conditional compilation question

开发者_StackOverflow社区I have two projects A and B. A depends on B. I would like the following to happen

If B define a conditional compilation symbol, I would like A also define it automatically. Can I achieve this?


No, basically. Compilation symbols are applied on a per-project basis in the project settings, and on a per-file basis depending on #define pragmas. There's no way of making the project you're compiling against determine your compilation symbols - they vanish after compilation, effectively.

It would be simplest to create appropriate solution-wide configurations, and project configurations within them which define the appropriate symbols.


If you have lots of project files,

  • Use custom MSBuild script
  • Or write a "project file generator" that will create all your project files for you (they are just XML after all)

(It is a real pity you can't selet more then one project file then "multi edit" them)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜