From e07f80ac344b291b54a3fd5a333906782ab4809e Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 28 Nov 2023 14:36:40 -0500 Subject: [PATCH] [wasi] Fix incremental build (#95307) This follows the convention from `WasmApp.*targets` of writing to `.rsp` files, and then adding them to the dependencies to trigger native relinking. Fixes https://github.com/dotnet/runtime/issues/95192 . Fixes https://github.com/dotnet/runtime/issues/95273 . --- src/mono/wasi/build/WasiApp.Native.targets | 32 ++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/mono/wasi/build/WasiApp.Native.targets b/src/mono/wasi/build/WasiApp.Native.targets index 34ada49a624b3..882ea43c97470 100644 --- a/src/mono/wasi/build/WasiApp.Native.targets +++ b/src/mono/wasi/build/WasiApp.Native.targets @@ -156,6 +156,9 @@ + + + <_WasmCommonIncludePaths Include="$(_WasmIntermediateOutputPath.TrimEnd('\/'))" /> <_WasmCommonIncludePaths Include="$(_WasmRuntimePackIncludeDir)mono-2.0" /> <_WasmCommonIncludePaths Include="$(_WasmRuntimePackIncludeDir)wasm" /> @@ -410,13 +413,7 @@ - - - + @@ -434,9 +431,9 @@ WriteOnlyWhenDifferent="true" /> - - + + <_WasiClangXLinkerFlags Include="--initial-memory=$(WasmInitialHeapSize)" /> <_WasmNativeFileForLinking Include="@(NativeFileReference)" /> @@ -445,6 +442,8 @@ <_WasiFilePathForFixup Include="@(_WasiObjectFilesForBundle)" /> <_WasiFilePathForFixup Include="@(_WasmNativeFileForLinking)" /> + <_WasmLinkDependencies Include="@(_WasiFilePathForFixup)" /> + <_WasiSdkClangArgs Condition="'$(OS)' == 'Windows_NT'" Include=""$([System.String]::new(%(_WasiFilePathForFixup.Identity)).Replace('\', '/'))"" /> <_WasiSdkClangArgs Condition="'$(OS)' != 'Windows_NT'" Include="@(_WasiFilePathForFixup -> '"%(Identity)"')" /> @@ -460,7 +459,18 @@ <_WasiSdkClangArgs Include="-o "$(_WasmOutputFileName.Replace('\', '/'))"" /> - + + + <_WasmLinkDependencies Include="$(_WasiClangLinkRsp)" /> + + + + + @@ -614,5 +624,5 @@ - +