Skip to content

Commit

Permalink
[mono] Compile runtime with MBR support by default on Android and Bro…
Browse files Browse the repository at this point in the history
…wser (#47785)

Contributes to #44806
  • Loading branch information
lambdageek committed Feb 4, 2021
1 parent 8033217 commit 9f31242
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR(CMAKE_CXX_COMPILER_ID STREQUAL "Cla
set(GCC 1)
endif()

if(DISABLE_INTERPRETER)
unset(ENABLE_METADATA_UPDATE)
endif()

add_definitions(-DHAVE_CONFIG_H)
add_definitions(-DMONO_DLL_EXPORT)

Expand Down
7 changes: 7 additions & 0 deletions src/mono/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@
<AndroidTestRunnerProjDirectory>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'Common', tests, 'AndroidTestRunner'))</AndroidTestRunnerProjDirectory>
<MonoAOTCompilerProjDirectory>$([MSBuild]::NormalizeDirectory('$(RepoTasksDir)', 'AotCompilerTask'))</MonoAOTCompilerProjDirectory>
</PropertyGroup>

<!-- Feature defaults for mono.proj and System.Private.CoreLib.csproj -->
<PropertyGroup>
<!-- default metadata update support for specific platforms -->
<MonoMetadataUpdate Condition="'$(MonoMetadataUpdate)' == '' and ('$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true')">true</MonoMetadataUpdate>
<MonoMetadataUpdate Condition="'$(MonoMetadataUpdate)' == ''">false</MonoMetadataUpdate>
</PropertyGroup>
</Project>
8 changes: 3 additions & 5 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- MonoAOTEnableLLVM - enable LLVM for an AOT-only Mono
- MonoAOTLLVMDir - [optional] the directory where LLVM is located, for an AOT-only Mono
- MonoVerboseBuild - enable verbose build
- MonoMetadataUpdate - enable experimental method body replacement code
- MonoMetadataUpdate - enable experimental method body replacement code (in Directory.Build.props)
- MonoThreadSuspend - coop,hybrid,preemptive - default thread suspend mode
-->

Expand Down Expand Up @@ -321,9 +321,8 @@
<_MonoAOTCXXFLAGS Include="-Wl,--build-id=sha1" />
</ItemGroup>

<!-- Experimental features -->
<!-- Devloop features -->
<ItemGroup Condition="'$(MonoMetadataUpdate)' == 'true'">
<!-- FIXME: Add sanity check that the interpreter is enabled -->
<_MonoCMakeArgs Include="-DENABLE_METADATA_UPDATE=1" />
</ItemGroup>

Expand Down Expand Up @@ -442,8 +441,7 @@
<MonoAOTCMakeArgs Condition="'$(MonoAOTEnableLLVM)' == 'true'" Include="-DLLVM_PREFIX=$(MonoAOTLLVMDir)" />
<MonoAOTCMakeArgs Include="$(_MonoAOTCFLAGSOption)" />
<MonoAOTCMakeArgs Include="$(_MonoAOTCXXFLAGSOption)" />
<!-- Experimental features -->
<!-- FIXME: Add sanity check that the interpreter is enabled -->
<!-- Devloop features -->
<MonoAOTCMakeArgs Condition="'$(MonoMetadataUpdate)' == 'true'" Include="-DENABLE_METADATA_UPDATE=1" />

<!-- thread suspend -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!-- Generate Mono corelib version file -->
<Import Project="GenerateMonoCoreLibVersionFile.targets" />

Expand Down
5 changes: 5 additions & 0 deletions src/mono/wasm/wasm.proj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<WasmEnableMetadataUpdate Condition="'$(MonoMetadataUpdate)' == 'true'">true</WasmEnableMetadataUpdate>
</PropertyGroup>

<PropertyGroup>
<!-- TODO: set to "false" for publishing/production builds -->
<MonoMetadataUpdate Condition="'$(MonoMetadataUpdate)' == ''">true</MonoMetadataUpdate>
</PropertyGroup>

<Target Name="CheckEnv">
<Error Condition="'$(TargetArchitecture)' != 'wasm'" Text="Expected TargetArchitecture==wasm, got '$(TargetArchitecture)'"/>
<Error Condition="'$(TargetOS)' != 'Browser'" Text="Expected TargetOS==Browser, got '$(TargetOS)'"/>
Expand Down

0 comments on commit 9f31242

Please sign in to comment.