Is there a way to globally declare a #define?
Like I want to have a file that has for instance,
#define MONO
and I want all source-
In case you have both C# and C++ projects in the solution and need to share preprocessor definitions among them.
Create some SolutionDefines.targets file near your *.sln as follows
$(DefineConstants);MY_DEFINITION
MY_DEFINITION;%(PreprocessorDefinitions)
Then add to C/C++/C# *.vcproj/*.vcxproj/*.csproj project files this line somewhere in the end
Ok, now you can enjoy #if MY_DEFINITION in C# and #ifdef MY_DEFINITION in C/C++. Visual Studio C# editor doesn't like this way and tells there is no MY_DEFINITION defined. But, C# compiler csc.exe gets the symbol properly.