I need to determine at runtime which compilation options were used to create the executable. Is there any way to do this?
EDIT: I'm particularly interested in finding optimization settings. The reason is because I am writing commercial software that should work as quickly as possible. Although I just modify and test the system, I do not do all the optimizations because it takes too much time. But I worry that I might accidentally go out and publish a non-optimized version of the program. I would like the program to give me a visual warning at startup, saying something like "This is a slow version - don't let go."
EDIT: Perhaps I could write a small utility to run as a pre-build step? Is somewhere in some file stored on the command line? If so, I can extract it and then write it to some include file as a string and hey presto!
EDIT: My choice is not between debugging and release. Debugging is too slow - I reserve it strictly for debugging. My daily choice is between optimized and super-optimized (including slow link layout compilation or even profile optimization).
EDIT: I often make changes to the complicated compilation process, different libraries, different predefined macros, different source files, etc. It seems inconvenient to maintain several almost identical project files that differ only in a few optimization flags. I would rather simply, somehow and sometime, switch a couple of flags into one project and recompile. I just want the executable to independently test how it was created.
EDIT: IIRC is there some way to ask visual studio to create a makefile. Can I ask visual studio to create this makefile for me as a pre-build step?
source
share