[wasm] Fix blazor/aot builds (#54651)
authorAnkit Jain <radical@gmail.com>
Thu, 24 Jun 2021 02:29:00 +0000 (22:29 -0400)
committerGitHub <noreply@github.com>
Thu, 24 Jun 2021 02:29:00 +0000 (21:29 -0500)
`dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.0-preview.7.21321.15\Sdk\WasmApp.Native.targets(342,5): error : Could not find AOT cross compiler at $(_MonoAotCrossCompilerPath)=`

Make sure this is set for the aot path.

src/mono/wasm/build/WasmApp.Native.targets

index c034763..e1de26e 100644 (file)
@@ -359,6 +359,10 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_
   -->
 
   <Target Name="_WasmAotCompileApp" Condition="'$(RunAOTCompilation)' == 'true'">
+    <PropertyGroup>
+      <_MonoAotCrossCompilerPath>@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','browser-wasm'))</_MonoAotCrossCompilerPath>
+    </PropertyGroup>
+
     <Error Condition="'@(_WasmAssembliesInternal)' == ''" Text="Item _WasmAssembliesInternal is empty" />
     <Error Condition="'$(_IsEMSDKMissing)' == 'true'"
            Text="$(_EMSDKMissingErrorMessage) Emscripten SDK is required for AOT'ing assemblies." />