From 6130aeebaf6e09cecd7d3d89ec9a072f1c5bde06 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Thu, 18 May 2023 17:39:24 -0400 Subject: [PATCH] fix: Adjust response file for aot-instances --- src/Uno.Wasm.Packager/packager.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Uno.Wasm.Packager/packager.cs b/src/Uno.Wasm.Packager/packager.cs index b843d9e5a..4720202eb 100644 --- a/src/Uno.Wasm.Packager/packager.cs +++ b/src/Uno.Wasm.Packager/packager.cs @@ -1411,6 +1411,10 @@ int Run (string[] args) { // environment.Add("MONO_THREADS_SUSPEND=coop"); } + var response_prefix = is_windows + ? "`@" + : "@"; + var aot_cross_prefix = is_windows ? $"cmd /c set \"MONO_PATH=$mono_path\" &&" + string.Join(" ", environment.Select(e => $"set \"{e}\" &&")) : string.Join(" ", environment); @@ -1419,11 +1423,14 @@ int Run (string[] args) { ninja.WriteLine ("rule aot"); ninja.WriteLine ($" command = {aot_cross_prefix} $cross --debug {profiler_aot_args} {aot_compiler_options} --aot=$aot_args,$aot_base_args,depfile=$depfile,llvm-outfile=$outfile $src_file"); ninja.WriteLine (" description = [AOT] $src_file -> $outfile"); + ninja.WriteLine ("rule aot-instances"); - ninja.WriteLine ($" command = {aot_cross_prefix} $cross --debug {profiler_aot_args} {aot_compiler_options} --aot=$aot_base_args,llvm-outfile=$outfile,dedup-include=$dedup_image $src_files"); + ninja.WriteLine ($" command = {aot_cross_prefix} $cross --response=$builddir/aot-instances.rsp"); + ninja.WriteLine ($" rspfile = $builddir/aot-instances.rsp"); + ninja.WriteLine ($" rspfile_content = --debug {profiler_aot_args} {aot_compiler_options} --aot=$aot_base_args,llvm-outfile=$outfile,dedup-include=$dedup_image $src_files"); ninja.WriteLine (" description = [AOT-INSTANCES] $outfile"); - ninja.WriteLine ("rule mkdir"); + ninja.WriteLine ("rule mkdir"); if (Environment.OSVersion.Platform != PlatformID.Win32NT) { ninja.WriteLine(" command = mkdir -p $out"); @@ -1475,10 +1482,6 @@ int Run (string[] args) { ? "powershell" : ""; - var response_prefix = is_windows - ? "`@" - : "@"; - ninja.WriteLine ("rule create-emsdk-env"); ninja.WriteLine ($" command = {tools_shell_prefix} \"$emscripten_sdkdir/emsdk\" construct_env > $out");