Fix CoreLib path resolution (#39921)
authorViktor Hofer <viktor.hofer@microsoft.com>
Sat, 25 Jul 2020 18:34:14 +0000 (20:34 +0200)
committerGitHub <noreply@github.com>
Sat, 25 Jul 2020 18:34:14 +0000 (20:34 +0200)
Fixes issue described in https://github.com/dotnet/runtime/pull/39891#issuecomment-663767530.

src/mono/wasm/wasm.targets

index e3210db..9934c9a 100644 (file)
       <WasmPInvokeModule Include="libSystem.Native" />
       <WasmPInvokeModule Include="libSystem.IO.Compression.Native" />
       <WasmPInvokeModule Include="libSystem.Globalization.Native" />
-      <!-- Include CoreLib via the CollectedBuildOutput as it isn't binplaced into the runtime pack at this time. -->
-      <WasmPInvokeAssembly Include="@(CollectedBuildOutput)"
-                           Condition="'%(CollectedBuildOutput.MSBuildSourceProjectFile)' == '$(CoreLibProject)'" />
       <WasmPInvokeAssembly Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*.dll" />
     </ItemGroup>
-
-    <MakeDir Directories="$(ArtifactsObjDir)wasm"/>
+    
+    <!-- Retrieve CoreLib's targetpath via GetTargetPath as it isn't binplaced yet. -->
+    <MSBuild Projects="$(CoreLibProject)"
+             Targets="GetTargetPath">
+      <Output TaskParameter="TargetOutputs" ItemName="WasmPInvokeAssembly" />
+    </MSBuild>
+
+    <MakeDir Directories="$(ArtifactsObjDir)wasm" />
     <PInvokeTableGenerator Modules="@(WasmPInvokeModule)"
                            Assemblies="@(WasmPInvokeAssembly)"
                            OutputPath="$(WasmPInvokeTablePath)" />