Skip to content

Commit

Permalink
try to workaround dotnet/msbuild#2811
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdageek committed Feb 16, 2024
1 parent f6dcfe8 commit b94c67a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/native/libhellomanaged/compile-native.proj
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@

<!-- FIXME: incremental build -->
<Target Name="BuildNativeLibs" BeforeTargets="Build" Condition="$(SupportsNativeAotComponents)">
<Message Importance="High" Text="Restoring native libs @(NativeLibsProjectsToBuild)" />
<Message Importance="High" Text="Restoring native libs RuntimeConfiguration=$(RuntimeConfiguration) LibrariesConfiguration=$(LibrariesConfiguration)" />
<!-- workaround https://github.com/dotnet/msbuild/issues/2811 - Restore has to be a separate exectution with a different evaluation -->
<MSBuild Projects="@(NativeLibsProjectsToBuild)"
Properties="Configuration=$(NativeLibsPublishConfiguration);RuntimeConfiguration=$(RuntimeConfiguration);LibrariesConfiguration=$(LibrariesConfiguration);RuntimeIdentifier=$(OutputRID);NativeLib=$(NativeLibKind);_RandomPropertyToPleaseMSBuild=Restoring"
Targets="Restore" />

<Message Importance="High" Text="Building native libs @(NativeLibsProjectsToBuild)" />
<Message Importance="High" Text="Building native libs RuntimeConfiguration=$(RuntimeConfiguration) LibrariesConfiguration=$(LibrariesConfiguration)" />
<MSBuild Projects="@(NativeLibsProjectsToBuild)"
Properties="Configuration=$(NativeLibsPublishConfiguration);RuntimeConfiguration=$(RuntimeConfiguration);LibrariesConfiguration=$(LibrariesConfiguration);RuntimeIdentifier=$(OutputRID);NativeLib=$(NativeLibKind)"
Targets="Restore;Build;Publish" />
Properties="Configuration=$(NativeLibsPublishConfiguration);RuntimeConfiguration=$(RuntimeConfiguration);LibrariesConfiguration=$(LibrariesConfiguration);RuntimeIdentifier=$(OutputRID);NativeLib=$(NativeLibKind);_RandomOtherPropertyToPleaseMSBuild=BuildingAndPublishing"
Targets="Build;Publish" />
</Target>
</Project>

0 comments on commit b94c67a

Please sign in to comment.