Skip to content

Commit ba453bd

Browse files
akoeplingervargaz
andauthored
Set TargetsMobile=true on Browser TargetOS and build the wasm runtimes earlier during the libs build (#36337)
* Set TargetsMobile=true on Browser TargetOS * Build the wasm runtimes earlier during the libs build so they end up in lib-runtime-packs. * Add emsdk_env.sh into .gitignore Co-authored-by: Zoltan Varga <vargaz@gmail.com>
1 parent f3a3e64 commit ba453bd

11 files changed

+22
-20
lines changed

eng/Configurations.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</PropertyGroup>
5353

5454
<PropertyGroup>
55-
<TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS'">true</TargetsMobile>
55+
<TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'Browser'">true</TargetsMobile>
5656
</PropertyGroup>
5757

5858
<!--Feature switches -->

eng/Subsets.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
<PropertyGroup>
4040
<DefaultSubsets>clr+mono+libs+installer</DefaultSubsets>
41-
<DefaultSubsets Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'">mono+libs+installer</DefaultSubsets>
41+
<DefaultSubsets Condition="'$(TargetsMobile)' == 'true'">mono+libs+installer</DefaultSubsets>
4242
</PropertyGroup>
4343

4444
<!-- Init _subset here in to allow RuntimeFlavor to be set as early as possible -->
@@ -48,7 +48,7 @@
4848
</PropertyGroup>
4949

5050
<PropertyGroup>
51-
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'">Mono</RuntimeFlavor>
51+
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
5252
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>
5353
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
5454
</PropertyGroup>

eng/codeOptimization.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
IBCMerge optimizations on Mac for now to unblock the offical build.
1010
See issue https://github.com/dotnet/runtime/issues/33303
1111
-->
12-
<IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'">false</IsEligibleForNgenOptimization>
12+
<IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true'">false</IsEligibleForNgenOptimization>
1313
</PropertyGroup>
1414

1515
<Target Name="SetApplyNgenOptimization"

eng/liveBuilds.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@
133133
<IsNative>true</IsNative>
134134
</RuntimeFiles>
135135

136-
<MonoCrossFiles Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'"
136+
<MonoCrossFiles Condition="'$(TargetsMobile)' == 'true'"
137137
Include="$(MonoArtifactsPath)\cross\*.*" />
138-
<MonoIncludeFiles Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'"
138+
<MonoIncludeFiles Condition="'$(TargetsMobile)' == 'true'"
139139
Include="$(MonoArtifactsPath)\include\**\*.*" />
140140
<WasmDistFiles Condition="'$(TargetOS)' == 'Browser'"
141141
Include="$(MonoArtifactsPath)\wasm\runtimes\**\*.*" />

src/installer/Directory.Build.props

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
<PropertyGroup>
218218
<TargetsBrowser>true</TargetsBrowser>
219219
<TargetsUnix>true</TargetsUnix>
220+
<TargetsMobile>true</TargetsMobile>
220221
</PropertyGroup>
221222
</When>
222223
<When Condition="$(OutputRid.StartsWith('debian'))">
@@ -362,7 +363,7 @@
362363
<CrossGenSymbolExtension>.map</CrossGenSymbolExtension>
363364
<CrossGenSymbolExtension Condition="'$(TargetOS)' == 'Windows_NT'">.ni.pdb</CrossGenSymbolExtension>
364365
<!-- OSX doesn't have crossgen symbols, yet -->
365-
<CrossGenSymbolExtension Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true' or '$(TargetsBrowser)' == 'true'"></CrossGenSymbolExtension>
366+
<CrossGenSymbolExtension Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true'"></CrossGenSymbolExtension>
366367
</PropertyGroup>
367368

368369
</Project>

src/installer/pkg/projects/Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</PropertyGroup>
2727
</Target>
2828

29-
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true' and '$(TargetsBrowser)' != 'true'">
29+
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true'">
3030
<RuntimeSpecificFrameworkSuffix>.Mono</RuntimeSpecificFrameworkSuffix>
3131
</PropertyGroup>
3232

src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
Include="@(MonoCrossFiles)">
7272
<TargetPath>runtimes/$(PackageRID)/native/cross</TargetPath>
7373
</RuntimeFiles>
74-
<RuntimeFiles Condition="'$(TargetsMobile)' == 'true' or '$(TargetsBrowser)' == 'true'"
74+
<RuntimeFiles Condition="'$(TargetsMobile)' == 'true'"
7575
Include="@(MonoIncludeFiles)">
7676
<TargetPath>runtimes/$(PackageRID)/native/include/%(RecursiveDir)</TargetPath>
7777
</RuntimeFiles>

src/libraries/Directory.Build.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetsMobile)' == 'true'">x64</TargetArchitecture>
4242
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
4343

44-
<!-- RuntimeOS is calculated based on the build system OS, however if building for WebAssembly/iOS/Android we need to let
45-
the build system to use webassembly/ios/android as the RuntimeOS for produced package RIDs. -->
46-
<RuntimeOS Condition="'$(TargetOS)' == 'Browser' or '$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
44+
<!-- RuntimeOS is calculated based on the build system OS, however if building for Browser/iOS/Android we need to let
45+
the build system to use browser/ios/android as the RuntimeOS for produced package RIDs. -->
46+
<RuntimeOS Condition="'$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
4747

4848
<!-- Initialize BuildSettings from the individual properties if it wasn't already explicitly set -->
4949
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>

src/libraries/pretest.proj

-8
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@
7272
TargetRuntimeIdentifier="$(PackageRID)" />
7373
</Target>
7474

75-
<!-- Wasm runtimes depend on the mono runtime and libs to be built, so they can only be built here -->
76-
<Target Name="BuildWasmPackageDependency"
77-
Condition="'$(TargetOS)' == 'Browser'"
78-
AfterTargets="RestoreTestHost">
79-
<MSBuild Projects="$(MonoProjectRoot)\wasm\wasm.proj"
80-
Properties="Configuration=$(Configuration);TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture)"/>
81-
</Target>
82-
8375
<UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetBuildTasksSharedFrameworkTaskFile)"/>
8476
<Target Name="GenerateFrameworkListFile"
8577
Condition="'$(BinPlaceTestRuntimePack)' == 'true'"

src/libraries/src.proj

+8
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,12 @@
4646
Properties="$(TraversalGlobalProperties)" />
4747
</Target>
4848

49+
<!-- Wasm runtimes depend on the mono runtime and libs to be built, so they can only be built here -->
50+
<Target Name="BuildWasmPackageDependency"
51+
Condition="'$(TargetOS)' == 'Browser'"
52+
AfterTargets="Build">
53+
<MSBuild Projects="$(MonoProjectRoot)\wasm\wasm.proj"
54+
Properties="Configuration=$(Configuration);TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture)"/>
55+
</Target>
56+
4957
</Project>

src/mono/wasm/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/emsdk_env.sh

0 commit comments

Comments
 (0)