> Date: Mon, 9 Jan 2006 11:13:22 -0800
> From: Joe Buck <[EMAIL PROTECTED]>
> 
> On Mon, Jan 09, 2006 at 01:46:21PM -0500, David Taylor wrote:
> > For a variety of reasons, we would like to be able to specify
> > individual compilation switches *within* individual files.
> 
> You don't need a gcc modification to do that; you can arrange to get
> the compiler flags from a comment in the file.  A bit of scripting,
> and your build system can find these comments, and either use a default
> flag set or generate an error if the magic comment is not found.

We're considering that option.

One of the considerations is that some files are compiled 20+ times
(e.g., if it's present in a lot of variations of the product and
contains conditional compilation), and the individual compilation
options sometimes vary depending upon which variation the file is
being compiled for -- so, we'd like to be able to use CPP.

Yes, we can run a sed or awk or perl script over the file, feed the
output to cpp, and then modify the compiler invocation line as
appropriate.  It's something we have considered doing.

But, less than 10% of the files have individual compilation options --
over 90% of the files use the generic set without any additions (and
the percentage using the generic set is likely to increase over time).
We would end up invoking the script more than a dozen times for files
without individual compilation switches for every time we invoked it
for a file with individual compilation switches.

So, I'd prefer to avoid the overhead of the script if I could.

David
--
David Taylor
[EMAIL PROTECTED]

Reply via email to