Where I work, we have a large codebase of C code that we build using Visual Studio 2005. It's separated into a variety of projects, including several static libraries. There are two solutions we primarily use, Full Debug (which turns off optimizations entirely), and Debug (we selectively optimize around 20% of files, while leaving the rest unoptimized for ease of debugging). Right now we enable the selective optimization of files by setting those properties on each file individually.
This system SORT of works, but is a giant pain because of the very large size of our project. I was looking into adding manual precompiled headers into our code base, but ran into the problem that the optimization setting of the precompiled header must match that of the C file. So, for our Debug build I need to make two precompiled headers, one optimized and one not. I would then set the project to use the nonoptimized one, and go through to each optimized file and manually change which precompiled header to use. I don't really want to do this.
What are some possible solutions for this? If there was some way to apply property sheets to individual files (as opposed to an entire configuration) that would make things a lot easier. Also, if I could somehow craft a macro statement for the precompiled header location ($(confname)/$(valueofparameteroptimized).pch or something) that would also solve it. Or, if those aren't possible, what solutions do people create adhoc for dealing with setting properties on subsets of files? Upgrading to 2008 is an option, if there's some solution there that would fix it (we were thinking about upgrading anyway).