-
May 22nd, 2011, 12:21 PM
#1
Preprocessor directive for the whole solution
I'm building an audio application. It can be built (optionally) with support for Steinberg's VST plugin architecture. To build with VST support I just need to define the preprocessor directive VST_SUPPORT.
The solution has around 20 projects so it's a bit of a pain to modify them all to either add or remove the VST_SUPPORT directive. I know I can select all 20 projects simultaneously and do them all together but I just wondered if there's a more elegant way - something like a preprocessor directive that I could apply to the top level solution which would then get inherited by every project?
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
May 22nd, 2011, 02:46 PM
#2
Re: Preprocessor directive for the whole solution
-
May 23rd, 2011, 06:33 AM
#3
Re: Preprocessor directive for the whole solution
Thanks. Another idea occurred to me (I don't know why I didn't think of this before) but all these modules use the compiler option "/FI" (force include) to force the incusion of a specific header file. At the moment it's needed to guarantee that all our devs will be linking to the same 'C' runtime version. I could probably use a similar approach for adding VST support. However, it depends on when the specified header gets force-incuded. I'm assuming it'll get included before any other headers. Hope that's a safe assumption!
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
May 23rd, 2011, 11:38 AM
#4
Re: Preprocessor directive for the whole solution
Project / Properties / Configuration Properties / C C++ / Preprocessor / Preprocessor definitions.
Command line switch /D
-
May 23rd, 2011, 02:04 PM
#5
Re: Preprocessor directive for the whole solution
Wouldn't I need to do that for every project? I'm looking for a solution that I can apply in a single place.
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
May 23rd, 2011, 03:16 PM
#6
Re: Preprocessor directive for the whole solution
The force include solution is probably easier. For both solutions you need to have different settings for different targets but since the force include already are at place you at least don't have to add edit all targets.
Here's what the help say about it:
This option has the same effect as specifying the file with double quotation marks in an #include directive on the first line of every source file specified on the command line, in the CL environment variable, or in a command file. If you use multiple /FI options, files are included in the order they are processed by CL.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|