❔ CSProj DefineConstants
I have the following in my csproj:
However, when I add the following code:
And set the configuration to
Any idea what I'm doing wrong?
<PropertyGroup>
...
<Configurations>Debug;Release;WIN-STEAM;MAC-STEAM;LIN-STEAM;WIN-GOG;MAC-GOG;LIN-GOG</Configurations>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(Configuration)' == 'WIN-STEAM'">$(DefineConstants);WINDOWS;STEAM</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'MAC-STEAM'">$(DefineConstants);MACOS;STEAM</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'LIN-STEAM'">$(DefineConstants);LINUX;STEAM</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'WIN-GOG'">$(DefineConstants);WINDOWS;GOG</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'MAC-GOG'">$(DefineConstants);MACOS;GOG</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'LIN-GOG'">$(DefineConstants);LINUX;GOG</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);WINDOWS;STEAM</DefineConstants>
</PropertyGroup> <PropertyGroup>
...
<Configurations>Debug;Release;WIN-STEAM;MAC-STEAM;LIN-STEAM;WIN-GOG;MAC-GOG;LIN-GOG</Configurations>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(Configuration)' == 'WIN-STEAM'">$(DefineConstants);WINDOWS;STEAM</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'MAC-STEAM'">$(DefineConstants);MACOS;STEAM</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'LIN-STEAM'">$(DefineConstants);LINUX;STEAM</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'WIN-GOG'">$(DefineConstants);WINDOWS;GOG</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'MAC-GOG'">$(DefineConstants);MACOS;GOG</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'LIN-GOG'">$(DefineConstants);LINUX;GOG</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);WINDOWS;STEAM</DefineConstants>
</PropertyGroup>However, when I add the following code:
#if MACOS && STEAM
Console.WriteLine("Mac");
#endif#if MACOS && STEAM
Console.WriteLine("Mac");
#endifAnd set the configuration to
MAC-STEAMMAC-STEAM (vs), the code does not get compiled into the project.Any idea what I'm doing wrong?