diff --git a/src/mono/netcore/sample/wasm/console/Makefile b/src/mono/netcore/sample/wasm/console/Makefile index dd7fc3b99e1df..7bf32731a7707 100644 --- a/src/mono/netcore/sample/wasm/console/Makefile +++ b/src/mono/netcore/sample/wasm/console/Makefile @@ -17,7 +17,7 @@ CONFIG?=Release all: build build: - EMSDK_PATH=$(realpath $(TOP)/src/mono/wasm/emsdk) $(DOTNET) publish $(DOTNET_Q_ARGS) $(DOTNET_RUN_AOT_COMPILATION_ARGS) /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=$(CONFIG) $(MSBUILD_ARGS) WasmSample.csproj + EMSDK_PATH=$(realpath $(TOP)/src/mono/wasm/emsdk) $(DOTNET) publish $(DOTNET_Q_ARGS) $(DOTNET_RUN_AOT_COMPILATION_ARGS) $(DOTNET_EXTRA_ARGS) /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=$(CONFIG) $(MSBUILD_ARGS) WasmSample.csproj clean: rm -rf bin diff --git a/src/mono/netcore/sample/wasm/console/WasmSample.csproj b/src/mono/netcore/sample/wasm/console/WasmSample.csproj index 494f9eae09c17..c45d56eb47a6d 100644 --- a/src/mono/netcore/sample/wasm/console/WasmSample.csproj +++ b/src/mono/netcore/sample/wasm/console/WasmSample.csproj @@ -39,9 +39,9 @@ $(AppBundleDir) - $(MSBuildProjectDirectory)\$(PublishDir)\ + $(MSBuildProjectDirectory)\$(PublishDir)\ $(MonoProjectRoot)\wasm\runtime-test.js - $(WasmAotDir)WasmSample.dll + $(WasmBuildDir)WasmSample.dll true diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 7b09f33d7f3e6..6903a2738c027 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -3,19 +3,28 @@ + + + + + + false + true + true + - _BeforeWasmBuildApp;_WasmResolveReferences;_WasmAOT + _BeforeWasmBuildApp;_WasmResolveReferences;_WasmBuildNative - - - $(MicrosoftNetCoreAppRuntimePackRidDir)native\src\emcc-flags.txt - $(MicrosoftNetCoreAppRuntimePackRidDir)native\src\emcc-version.txt - $(WasmAOTDir)emcc-version.txt - + @@ -37,7 +46,7 @@ OutputType="AsmOnly" Assemblies="@(AotInputAssemblies)" UseAotDataFile="false" - AotModulesTablePath="$(WasmAOTDir)driver-gen.c" + AotModulesTablePath="$(WasmBuildDir)driver-gen.c" UseLLVM="true" DisableParallelAot="true" LLVMPath="$(EMSDK_PATH)\upstream\bin"> @@ -63,10 +72,9 @@ - + - <_WasmAssemblies Include="$(WasmMainAssemblyPath);@(WasmAssembliesToBundle)" /> @@ -100,29 +108,75 @@ - + + + $(MicrosoftNetCoreAppRuntimePackRidDir)native\src\emcc-flags.txt + $(MicrosoftNetCoreAppRuntimePackRidDir)native\src\emcc-version.txt + $(WasmBuildDir)emcc-version.txt + $(EmccFlags) -s DISABLE_EXCEPTION_CATCHING=0 + $(EmccFlags) -DENABLE_AOT=1 -DDRIVER_GEN=1 - + - - - - + + + + + <_WasmPInvokeModules Include="libSystem.Native" /> + <_WasmPInvokeModules Include="libSystem.IO.Compression.Native" /> + <_WasmPInvokeModules Include="libSystem.Globalization.Native" /> + <_WasmPInvokeAssemblies Include="$(WasmBuildDir)\*.dll" /> + + + + + + <_WasmObjects Include="libmono-ee-interp.a"/> + <_WasmObjects Include="libmonosgen-2.0.a"/> + <_WasmObjects Include="libmono-ilgen.a"/> + <_WasmObjects Include="libmono-icall-table.a"/> + <_WasmObjects Include="libSystem.Native.a"/> + <_WasmObjects Include="libSystem.IO.Compression.Native.a"/> + <_WasmObjects Include="libicuuc.a"/> + <_WasmObjects Include="libicui18n.a"/> + <_WasmObjects Include="driver.o"/> + <_WasmObjects Include="pinvoke.o"/> + <_WasmObjects Include="corebindings.o"/> + + + + <_WasmIncludeDir>$(MicrosoftNetCoreAppRuntimePackRidDir)native/include + <_WasmSrcDir>$(MicrosoftNetCoreAppRuntimePackRidDir)native/src + <_WasmEmcc>source $(EMSDK_PATH)/emsdk_env.sh && emcc + $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 -I$(WasmBuildDir) -I$(_WasmIncludeDir)/mono-2.0 -I$(_WasmIncludeDir)/wasm + $(EmccFlags) -s TOTAL_MEMORY=536870912 + + + + + + +