I am writing a Visual Studio extension in C# and I need to capture programmatically all the options set by the compiler when the user runs a build.
I have realized that I can get some of them from the Project Properties (like all the -I and -D). But some are "invisible" and I realized that they are the macros set by the compiler itself. I have found a page listing all of them at: https://learn.microsoft.com/fr-fr/cpp/preprocessor/predefined-macros?view=vs-2019.
I could find a lot of those I am looking for: __cplusplus, _MSVC_LANG, _MSC_VER, _CPPRTTI, _MSC_FULL_VER, _MSC_EXTENSIONS, etc.
I am looking for the (C#) API allowing to get all those macros values programmatically so my VS extension can get them and inject them in my process.
Thanks for your help!