user496949
user496949

Reputation: 86155

conditional compilation question

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?

Upvotes: 4

Views: 385

Answers (2)

Ian Ringrose
Ian Ringrose

Reputation: 51927

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)

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1503090

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.

Upvotes: 6

Related Questions