0

I'm using Visual Studio 2010 on Windows 7. My project is written in C++.

There is a header file that has a lot of preprocessor logic to determine what version of a particular static library to link. It also prints a message to the build window. Well, as you can imagine, in the world of C++, everything ends up including everything, and this file gets parsed for just about every object file; the build window is flooded with the noise of the inefficiency of a file that contains boiler plate that better belongs in a make file.

I'd like to move this logic somehwere more logical, and where it only gets parsed once. I was thinking the pre-link custom build step. I've figured out all the conditional logic that is valid in build step syntax, but I don't know the command that would tell the linker "link this static library".

Is there a better way to conditionally link static libraries? What is the command I am missing to make it happen?

Note, I'm not in a position to include 3rd party build tools. No cmake, no incredibuild, none of their ilk. I'm trying to do this better as a solution native to VS, or I'll be stuck keeping it the way it is.

Thanks.

4

0 回答 0