Add build flag for easily overriding TFMs

Despite the name, this affects libs too, since those have to match (at least in terms of Framework vs. Core).
For example, you could build for .NET Framework 4.6.1 with:
`Dist/BuildDebug.sh -p:ExecProjTargetFrameworkOverride=net461`
and I believe that will run on XP and later... not sure about building for 32-bit machines though, hopefully that doesn't require code changes.
You can't go below `net461` because some of our NuGet dependencies aren't available on those targets.
You may pass .NET Core TFMs, but for that you should check out the existing branch+PR.
This commit is contained in:
James Groom 2024-05-07 00:56:05 +10:00 committed by GitHub
parent b8f2437e8c
commit d38b6d02d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,10 @@
<PropertyGroup Condition=" '$(MachineRunAnalyzersDuringBuild)' == '' ">
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(ExecProjTargetFrameworkOverride)' != '' AND '$(TargetFramework)' == 'net48' ">
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TargetFramework>$(ExecProjTargetFrameworkOverride)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Analyzer Include="$(MSBuildProjectDirectory)/../../References/BizHawk.SrcGen.ReflectionCache.dll" />
</ItemGroup>