Hello everyone!
Just for some context before I start, I am using Godot v4.1.3.stable.mono.official [f06b6836a], Rider as an IDE and have installed the godot support plugin. I want to be able to use the build configurations provided in rider to define preprocessor constants, so I can conditionally disable code. I am really confused as to the best way to do this. In Rider the build toolbar looks like this:

Where the left build with “Debug | Any CPU” config has a bunch of options, one of which is define constants, which looks exactly like what I want. These are the solution configs

The trouble is when I press play either in the editor or via rider these configurations do not look to be used. Instead, rider uses these configurations:

These configurations don’t seem to have a way to define constants in them. So I thought instead I could edit the .csproj file and add a conditional define in there, where I use the name of the config to enable certain defines:
<PropertyGroup Condition=" '$(Configuration)' == 'PlayerRelease' ">
<DefineConstants>EW_RELEASE</DefineConstants>
</PropertyGroup>
However, the configuration for every option; PlayerDebug, PlayerRelease (with either Run or Debug) and pressing play in editor all have the configuration name “debug”. I tested this by getting the configuration using the System.Assembly class,
`Assembly assembly = Assembly.GetExecutingAssembly();
object[] attributes = assembly.GetCustomAttributes(typeof(AssemblyConfigurationAttribute), false);
if (attributes.Length > 0 && attributes[0] is AssemblyConfigurationAttribute configurationAttribute)
{
// Print the configuration name
Logger.Print($"Configuration Name: {configurationAttribute.Configuration}");
} `
The only way I can think of defining a project wide define is by editing the .csproj file and just manually adding the define when I want to use it, but I find this to be a bit messy, and would rather define it on the basis of what configuration was selected.
<PropertyGroup>
<DefineConstants>EW_RELEASE</DefineConstants>
</PropertyGroup>
I also I think I am just generally confused about how builds work, for example, what is the point of the “Debug | Any CPU” build options when they don’t actually seem to be the configurations that are used when you run the game?
I haven’t ever really tried anything like this before, so please let me know if I am making silly mistakes or assumptions! Any help would be much appreciated, I am happy to clarify what I mean if need be 🙂