Minimize define hell

Skipping a 20 KB stub in OS-specific non-windows builds and omitting a few very fast if checks isn't worth the code quality degradation that involves all of the ifdef options.

ifdefs should be reserved for stuff that either doesn't compile whatsoever in some specific configurations (NETFRAMEWORK), or is required to make logical decisions based on the compiler input (e.g. DEBUG for detecting debugging builds or ASF_VARIANT_* for hardcoding the platform identifier to use for auto-updates)

In all other situations, we should use OperatingSystem if condition, even if it's equal to hitting them on the platforms that are unlikely to hit them.

And I say unlikely, because nothing stops me from downloading a win-x64 build and running it like a generic one on windows, what you gonna do?
This commit is contained in:
Archi
2021-11-10 19:03:05 +01:00
parent e62234892a
commit 0964cdac96
9 changed files with 11 additions and 68 deletions

View File

@@ -22,7 +22,7 @@
<PackageVersion Include="zxcvbn-core" Version="7.0.92" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net48' AND ('$(TargetGeneric)' == 'true' OR '$(TargetWindows)' == 'true')">
<ItemGroup Condition="'$(TargetFramework)' != 'net48'">
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="6.0.0" />
</ItemGroup>