Skip to content

Commit 118135e

Browse files
authored
adopt to recent NativeAOT changes (#2045)
* adopt to recent NativeAOT changes * make it more future-proof
1 parent 99ef3f1 commit 118135e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ private string GenerateProjectForNuGetBuild(BuildPartition buildPartition, Artif
137137
<IlcGenerateStackTraceData>{ilcGenerateStackTraceData}</IlcGenerateStackTraceData>
138138
<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> <!-- workaround for 'This runtime may not be supported by.NET Core.' error -->
139139
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
140+
{GetInstructionSetSettings(buildPartition)}
140141
</PropertyGroup>
141142
{GetRuntimeSettings(buildPartition.RepresentativeBenchmarkCase.Job.Environment.Gc, buildPartition.Resolver)}
142143
<ItemGroup>
@@ -152,9 +153,6 @@ private string GenerateProjectForNuGetBuild(BuildPartition buildPartition, Artif
152153
<ItemGroup>
153154
{string.Join(Environment.NewLine, GetRdXmlFiles(buildPartition.RepresentativeBenchmarkCase.Descriptor.Type, logger).Select(file => $"<RdXmlFile Include=\"{file}\" />"))}
154155
</ItemGroup>
155-
<ItemGroup>
156-
{GetInstructionSetSettings(buildPartition)}
157-
</ItemGroup>
158156
</Project>";
159157

160158
private string GetTrimmingSettings()
@@ -166,9 +164,7 @@ private string GetTrimmingSettings()
166164
private string GetInstructionSetSettings(BuildPartition buildPartition)
167165
{
168166
string instructionSet = ilcInstructionSet ?? GetCurrentInstructionSet(buildPartition.Platform);
169-
return !string.IsNullOrEmpty(instructionSet)
170-
? $@"<IlcArg Include=""--instructionset:{instructionSet}"" />"
171-
: "";
167+
return !string.IsNullOrEmpty(instructionSet) ? $"<IlcInstructionSet>{instructionSet}</IlcInstructionSet>" : "";
172168
}
173169

174170
public IEnumerable<string> GetRdXmlFiles(Type benchmarkTarget, ILogger logger)

0 commit comments

Comments
 (0)