Skip to content

Commit b8ef22b

Browse files
authored
Fix mono aot build (#3122)
* Fix mono aot build Issue: dotnet/BenchmarkDotNet#2311 - Use the extension props file to set `SelfContained=true` for the autogenerated project. This allows the project to have all the dependencies in the output folder, as required for AOT. - Latest BDN copies the `PackageReferences` from `MicroBenchmarks.csproj` to the generated project. - but it does not copy the version property, thus breaking the build. - Move the version property to a Common.props, so it can be used by the main MicroBenchmarks.csproj, and the autogenerated project. * MicroBenchmarks.Mono.props - remove SelfContained=true as it has been moved to the template project in BDN
1 parent 6edcb7c commit b8ef22b

File tree

3 files changed

+35
-24
lines changed

3 files changed

+35
-24
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project>
2+
<!-- Shared with the autogenerated project -->
3+
4+
<!-- out-of-band packages that are not included in NetCoreApp have TFM-specific versions -->
5+
<Choose>
6+
<When Condition="'$(TargetFramework)' == 'net6.0'">
7+
<PropertyGroup>
8+
<LangVersion>10.0</LangVersion>
9+
<ExtensionsVersion>6.0.0</ExtensionsVersion>
10+
<SystemVersion>6.0.0</SystemVersion>
11+
</PropertyGroup>
12+
</When>
13+
<When Condition="'$(TargetFramework)' == 'net7.0'">
14+
<PropertyGroup>
15+
<LangVersion>11.0</LangVersion>
16+
<ExtensionsVersion>7.0.0</ExtensionsVersion>
17+
<SystemVersion>7.0.0</SystemVersion>
18+
</PropertyGroup>
19+
</When>
20+
<Otherwise>
21+
<!-- when comparing against Full .NET Framework we are usually interested in CLR differences, so net462 belongs to this block -->
22+
<PropertyGroup>
23+
<ExtensionsVersion>7.0.0</ExtensionsVersion>
24+
<SystemVersion>7.0.0</SystemVersion>
25+
</PropertyGroup>
26+
</Otherwise>
27+
</Choose>
28+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Project>
2+
<!-- Shared with the autogenerated project -->
3+
<Import Project="*Common.props" />
4+
</Project>

src/benchmarks/micro/MicroBenchmarks.csproj

+3-24
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,9 @@
2020
<!-- Allow building with one major version, and running using a sdk with a higher major version -->
2121
<RollForward Condition="'$(BuildingForWasm)' == 'true'">LatestMajor</RollForward>
2222
</PropertyGroup>
23-
<!-- out-of-band packages that are not included in NetCoreApp have TFM-specific versions -->
24-
<Choose>
25-
<When Condition="'$(TargetFramework)' == 'net6.0'">
26-
<PropertyGroup>
27-
<LangVersion>10.0</LangVersion>
28-
<ExtensionsVersion>6.0.0</ExtensionsVersion>
29-
<SystemVersion>6.0.0</SystemVersion>
30-
</PropertyGroup>
31-
</When>
32-
<When Condition="'$(TargetFramework)' == 'net7.0'">
33-
<PropertyGroup>
34-
<LangVersion>11.0</LangVersion>
35-
<ExtensionsVersion>7.0.0</ExtensionsVersion>
36-
<SystemVersion>7.0.0</SystemVersion>
37-
</PropertyGroup>
38-
</When>
39-
<Otherwise>
40-
<!-- when comparing against Full .NET Framework we are usually interested in CLR differences, so net462 belongs to this block -->
41-
<PropertyGroup>
42-
<ExtensionsVersion>7.0.0</ExtensionsVersion>
43-
<SystemVersion>7.0.0</SystemVersion>
44-
</PropertyGroup>
45-
</Otherwise>
46-
</Choose>
23+
24+
<Import Project="$(MSBuildThisFileDirectory)MicroBenchmarks.Common.props" />
25+
4726
<ItemGroup>
4827
<PackageReference Include="Jil" Version="3.0.0-alpha2" />
4928
<PackageReference Include="MessagePack" Version="1.9.11" />

0 commit comments

Comments
 (0)