VStudio 2010 custom build issue
I use an Oracle precompiler for embedded SQL. I'm moving some code from VC++ 6.0 to VStudio 2010.
I place database calls in a single source code module named "dbcalls.pc" - that gets passed to the precompiler which produces "dbcalls.cpp" which then gets passed on to the compiler and linker like all other .cpp files.
Under VC6 I do a compile on my custom build .pc file manually - ie; rt click the dbcalls.pc file and choose compile. Then due to a bug in the specific version of the Oracle precompiler I use I have to open the .cpp and insert #include "stdafx.h" at the top of the .cpp produced by by the precompiler - I have a macro that does this. Then I can perform a build on the entire project and the VC6 IDE will NOT attempt to re-run the custom build.
In VStudio 2010, I have replicated this with one important exception/problem - if I configure the dbcalls.pc file to be excluded from the build under properties (where it is specified as being of type custom build) then I am unable to rt click the file and choose compile.
If I set the property to be included in the build I can rt click and manually build the .pc into the .cpp but then after I alter the .cpp when I run a build for the project it reruns the custom build and removes my changes. I'm forced to go back and forth with the properties dialog and change the "exclude from build" setting. This is a royal PITA that does not happen in VC6.
Can anyone suggest workaround? Obviously if the precompiler did not have this bug then all would be good but moving to another v开发者_如何学Cersion of the pc is not currently in the cards.
thoughts?
OK - I'm not sure why - perhaps I swung the chicken over my head just the right amount of times.. - but it's working correctly now.
I resolved another issue I had with macro arguments to the precompiler in the custom build dialog and once I did that it started doing the conditional build correctly (or at least as I expected it to work).
Shrugged my shoulders a few times and said "case closed".
精彩评论