If I wanted to add, let’s say, a new .lib to the build only if a particular #define was set, how would I do that?
In the MSVC++ 2008 “Property Pages”, you would simply add: Config Properties -> Linker -> Input -> Additional Dependencies, but I would like it if something like #define COMPILE_WITH_DETOURS was set, then the particular library would be added to the dependencies, otherwise it would be removed.
You can set some linker options by using
#pragma commentin one of your source files.For example, to link against a ‘detours.lib’ library only if
COMPILE_WITH_DETOURSis defined, you can use:(this is specific to Microsoft Visual C++ and is not portable)