Set TargetsMobile=true on Browser TargetOS and build the wasm runtimes earlier during...
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 13 May 2020 16:39:17 +0000 (18:39 +0200)
committerGitHub <noreply@github.com>
Wed, 13 May 2020 16:39:17 +0000 (18:39 +0200)
* 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>
eng/Configurations.props
eng/Subsets.props
eng/codeOptimization.targets
eng/liveBuilds.targets
src/installer/Directory.Build.props
src/installer/pkg/projects/Directory.Build.targets
src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj
src/libraries/Directory.Build.props
src/libraries/pretest.proj
src/libraries/src.proj
src/mono/wasm/.gitignore [new file with mode: 0644]

index 94646e7..06f1aac 100644 (file)
@@ -52,7 +52,7 @@
   </PropertyGroup>
 
   <PropertyGroup>
-    <TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS'">true</TargetsMobile>
+    <TargetsMobile Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'Browser'">true</TargetsMobile>
   </PropertyGroup>
 
   <!--Feature switches -->
index 801ddb9..b628812 100644 (file)
@@ -38,7 +38,7 @@
 
   <PropertyGroup>
     <DefaultSubsets>clr+mono+libs+installer</DefaultSubsets>
-    <DefaultSubsets Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'">mono+libs+installer</DefaultSubsets>
+    <DefaultSubsets Condition="'$(TargetsMobile)' == 'true'">mono+libs+installer</DefaultSubsets>
   </PropertyGroup>
 
   <!-- Init _subset here in to allow RuntimeFlavor to be set as early as possible -->
@@ -48,7 +48,7 @@
   </PropertyGroup>
 
   <PropertyGroup>
-    <RuntimeFlavor Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'">Mono</RuntimeFlavor>
+    <RuntimeFlavor Condition="'$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
     <RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>
     <RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
   </PropertyGroup>
index 34f89c0..6ed7e99 100644 (file)
@@ -9,7 +9,7 @@
            IBCMerge optimizations on Mac for now to unblock the offical build.
            See issue https://github.com/dotnet/runtime/issues/33303
       -->
-      <IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'">false</IsEligibleForNgenOptimization>
+      <IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true'">false</IsEligibleForNgenOptimization>
   </PropertyGroup>
 
   <Target Name="SetApplyNgenOptimization"
index 6462ef2..0101292 100644 (file)
         <IsNative>true</IsNative>
       </RuntimeFiles>
 
-      <MonoCrossFiles Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'"
+      <MonoCrossFiles Condition="'$(TargetsMobile)' == 'true'"
         Include="$(MonoArtifactsPath)\cross\*.*" />
-      <MonoIncludeFiles Condition="'$(TargetsMobile)' == 'true' or '$(TargetOS)' == 'Browser'"
+      <MonoIncludeFiles Condition="'$(TargetsMobile)' == 'true'"
         Include="$(MonoArtifactsPath)\include\**\*.*" />
       <WasmDistFiles Condition="'$(TargetOS)' == 'Browser'"
         Include="$(MonoArtifactsPath)\wasm\runtimes\**\*.*" />
index db4b337..1c6c0fb 100644 (file)
       <PropertyGroup>
         <TargetsBrowser>true</TargetsBrowser>
         <TargetsUnix>true</TargetsUnix>
+        <TargetsMobile>true</TargetsMobile>
       </PropertyGroup>
     </When>
     <When Condition="$(OutputRid.StartsWith('debian'))">
     <CrossGenSymbolExtension>.map</CrossGenSymbolExtension>
     <CrossGenSymbolExtension Condition="'$(TargetOS)' == 'Windows_NT'">.ni.pdb</CrossGenSymbolExtension>
     <!-- OSX doesn't have crossgen symbols, yet -->
-    <CrossGenSymbolExtension Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true' or '$(TargetsBrowser)' == 'true'"></CrossGenSymbolExtension>
+    <CrossGenSymbolExtension Condition="'$(TargetOS)' == 'OSX' or '$(TargetsMobile)' == 'true'"></CrossGenSymbolExtension>
   </PropertyGroup>
 
 </Project>
index 3617dde..b2450a8 100644 (file)
@@ -26,7 +26,7 @@
     </PropertyGroup>
   </Target>
 
-  <PropertyGroup Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true' and '$(TargetsBrowser)' != 'true'">
+  <PropertyGroup Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true'">
     <RuntimeSpecificFrameworkSuffix>.Mono</RuntimeSpecificFrameworkSuffix>
   </PropertyGroup>
 
index 7f97f90..4431cd5 100644 (file)
@@ -71,7 +71,7 @@
         Include="@(MonoCrossFiles)">
         <TargetPath>runtimes/$(PackageRID)/native/cross</TargetPath>
       </RuntimeFiles>
-      <RuntimeFiles Condition="'$(TargetsMobile)' == 'true' or '$(TargetsBrowser)' == 'true'"
+      <RuntimeFiles Condition="'$(TargetsMobile)' == 'true'"
         Include="@(MonoIncludeFiles)">
         <TargetPath>runtimes/$(PackageRID)/native/include/%(RecursiveDir)</TargetPath>
       </RuntimeFiles>
index 31abeb8..c82088b 100644 (file)
@@ -41,9 +41,9 @@
     <TargetArchitecture Condition="'$(TargetArchitecture)' == '' and '$(TargetsMobile)' == 'true'">x64</TargetArchitecture>
     <TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
 
-    <!-- RuntimeOS is calculated based on the build system OS, however if building for WebAssembly/iOS/Android we need to let
-         the build system to use webassembly/ios/android as the RuntimeOS for produced package RIDs. -->
-    <RuntimeOS Condition="'$(TargetOS)' == 'Browser' or '$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
+    <!-- RuntimeOS is calculated based on the build system OS, however if building for Browser/iOS/Android we need to let
+         the build system to use browser/ios/android as the RuntimeOS for produced package RIDs. -->
+    <RuntimeOS Condition="'$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant())</RuntimeOS>
  
     <!-- Initialize BuildSettings from the individual properties if it wasn't already explicitly set -->
     <Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
index 08b8f5a..d073141 100644 (file)
                                          TargetRuntimeIdentifier="$(PackageRID)" />
   </Target>
 
-  <!-- Wasm runtimes depend on the mono runtime and libs to be built, so they can only be built here -->
-  <Target Name="BuildWasmPackageDependency"
-          Condition="'$(TargetOS)' == 'Browser'"
-          AfterTargets="RestoreTestHost">
-    <MSBuild Projects="$(MonoProjectRoot)\wasm\wasm.proj"
-             Properties="Configuration=$(Configuration);TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture)"/>
-  </Target>
-
   <UsingTask TaskName="CreateFrameworkListFile" AssemblyFile="$(DotNetBuildTasksSharedFrameworkTaskFile)"/>
   <Target Name="GenerateFrameworkListFile"
           Condition="'$(BinPlaceTestRuntimePack)' == 'true'"
index b3b5f85..dbf6557 100644 (file)
              Properties="$(TraversalGlobalProperties)" />
   </Target>
 
+  <!-- Wasm runtimes depend on the mono runtime and libs to be built, so they can only be built here -->
+  <Target Name="BuildWasmPackageDependency"
+          Condition="'$(TargetOS)' == 'Browser'"
+          AfterTargets="Build">
+    <MSBuild Projects="$(MonoProjectRoot)\wasm\wasm.proj"
+             Properties="Configuration=$(Configuration);TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture)"/>
+  </Target>
+
 </Project>
diff --git a/src/mono/wasm/.gitignore b/src/mono/wasm/.gitignore
new file mode 100644 (file)
index 0000000..88ea006
--- /dev/null
@@ -0,0 +1 @@
+/emsdk_env.sh