<PropertyGroup>
<DefaultSubsets>clr+mono+libs+installer</DefaultSubsets>
<DefaultSubsets Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'tvOS'">mono+libs+installer</DefaultSubsets>
+ <DefaultSubsetCategories Condition="'$(TargetOS)' == 'WebAssembly'">mono+libs</DefaultSubsetCategories>
</PropertyGroup>
<PropertyGroup>
</PropertyGroup>
<PropertyGroup>
- <RuntimeFlavor Condition="'$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android'">Mono</RuntimeFlavor>
+ <RuntimeFlavor Condition="'$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'Android' or '$(TargetOS)' == 'WebAssembly'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and $(_subset.Contains('+mono.runtime+')) and !$(_subset.Contains('+clr.runtime+'))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">CoreCLR</RuntimeFlavor>
</PropertyGroup>
popd
else
- echo "Executing cmake --build \"$intermediatesDir\" --target install -j $__NumProc"
- cmake --build "$intermediatesDir" --target install -j "$__NumProc"
+ cmake_command=cmake
+ if [[ "$build_arch" == "wasm" ]]; then
+ cmake_command="emcmake $cmake_command"
+ fi
+
+ echo "Executing $cmake_command --build \"$intermediatesDir\" --target install -j $__NumProc"
+ $cmake_command --build "$intermediatesDir" --target install -j "$__NumProc"
fi
local exit_code="$?"
endif(CLR_CMAKE_HOST_OS STREQUAL Windows)
if(CLR_CMAKE_HOST_OS STREQUAL Emscripten)
- set(CLR_CMAKE_HOST_ARCH_WASM 1)
+ #set(CLR_CMAKE_HOST_UNIX 1) # TODO: this should be reenabled but it activates a bunch of additional compiler flags in configurecompiler.cmake
+ set(CLR_CMAKE_HOST_UNIX_WASM 1)
endif(CLR_CMAKE_HOST_OS STREQUAL Emscripten)
#--------------------------------------------
elseif(CLR_CMAKE_HOST_UNIX_X86)
set(CLR_CMAKE_HOST_ARCH_I386 1)
set(CLR_CMAKE_HOST_ARCH "x86")
+elseif(CLR_CMAKE_HOST_UNIX_WASM)
+ set(CLR_CMAKE_HOST_ARCH_WASM 1)
+ set(CLR_CMAKE_HOST_ARCH "wasm")
elseif(WIN32)
# CLR_CMAKE_HOST_ARCH is passed in as param to cmake
if (CLR_CMAKE_HOST_ARCH STREQUAL x64)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
set(CLR_CMAKE_TARGET_ARCH_ARMV7L 1)
set(ARM_SOFTFP 1)
+ elseif(CLR_CMAKE_TARGET_ARCH STREQUAL wasm)
+ set(CLR_CMAKE_TARGET_ARCH_WASM 1)
else()
clr_unknown_arch()
endif()
set(CLR_CMAKE_TARGET_SUNOS 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL SunOS)
+if(CLR_CMAKE_TARGET_OS STREQUAL Emscripten)
+ set(CLR_CMAKE_TARGET_UNIX 1)
+ set(CLR_CMAKE_TARGET_LINUX 1)
+ set(CLR_CMAKE_TARGET_EMSCRIPTEN 1)
+endif(CLR_CMAKE_TARGET_OS STREQUAL Emscripten)
+
if(CLR_CMAKE_TARGET_UNIX)
if(CLR_CMAKE_TARGET_ARCH STREQUAL x64)
set(CLR_CMAKE_TARGET_UNIX_AMD64 1)
set(CLR_CMAKE_TARGET_UNIX_ARM64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL x86)
set(CLR_CMAKE_TARGET_UNIX_X86 1)
+ elseif(CLR_CMAKE_TARGET_ARCH STREQUAL wasm)
+ set(CLR_CMAKE_TARGET_UNIX_WASM 1)
else()
clr_unknown_arch()
endif()
endif()
endif()
-if(NOT CLR_CMAKE_HOST_ARCH_WASM)
+if(NOT CLR_CMAKE_TARGET_EMSCRIPTEN)
# Skip check_pie_supported call on Android as ld from llvm toolchain with NDK API level 21
# complains about missing linker flag `-no-pie` (while level 28's ld does support this flag,
# but since we know that PIE is supported, we can safely skip this redundant check).
endif(NOT CLR_CMAKE_TARGET_ANDROID)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-endif(NOT CLR_CMAKE_HOST_ARCH_WASM)
+endif(NOT CLR_CMAKE_TARGET_EMSCRIPTEN)
string(TOLOWER "${CMAKE_BUILD_TYPE}" LOWERCASE_CMAKE_BUILD_TYPE)
if(LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug)
set(CLR_CMAKE_COMPILER_FILE_NAME_VERSION "${CMAKE_MATCH_0}")
endif()
-if(NOT WIN32)
+if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_ARCH_WASM)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(APPLE)
set(TOOLSET_PREFIX "")
cmake_command="$SCAN_BUILD_COMMAND $cmake_command"
fi
+if [[ "$build_arch" == "wasm" ]]; then
+ cmake_command="emcmake $cmake_command"
+fi
+
# Include CMAKE_USER_MAKE_RULES_OVERRIDE as uninitialized since it will hold its value in the CMake cache otherwise can cause issues when branch switching
$cmake_command \
-G "$generator" \
archType: wasm
platform: WebAssembly_wasm
container:
- image: ubuntu-16.04-20200401182342-fe8b85d
+ image: ubuntu-18.04-webassembly-20200409132031-f70ea41
registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, ''), eq(parameters.archType, 'arm')) }}:
- _runtimeOSArg: /p:RuntimeOS=ubuntu.16.04
+ # force a value for OS when cross-building WebAssembly
- ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}
- _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)'
- _testRunNamePrefixSuffix: $(runtimeFlavorName)_${{ parameters.liveRuntimeBuildConfig }}
- # WebAssembly uses linux implementation detail
- - ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- - _runtimeArtifactName: 'CoreLib_Linux_x64_${{ parameters.liveRuntimeBuildConfig }}'
-
# Windows variables
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- _runtimeOSArg: /p:RuntimeOS=win10
${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
dependsOn:
- - ${{ if ne(parameters.osGroup, 'WebAssembly') }}:
- # Use corelib dependencies for coreclr and non test builds
- - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.testScope, '')) }}:
- - ${{ format('coreclr_corelib_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
- - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}:
- - ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
- - ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- - ${{ format('coreclr_corelib_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, 'linux', parameters.osSubgroup, 'x64', parameters.liveRuntimeBuildConfig) }}
+ # Use corelib dependencies for coreclr and non test builds
+ - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.testScope, '')) }}:
+ - ${{ format('coreclr_corelib_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
+ - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}:
+ - ${{ format('{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeFlavor, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
variables:
- _subset: libs
- _addtionalBuildArguments: ''
- ${{ parameters.variables }}
- ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- - EMSDK_PATH: $(Build.BinariesDirectory)/emsdk
+ - EMSDK_PATH: /usr/local/emscripten
- ${{ if eq(parameters.runTests, true) }}:
- _subset: libs+libs.tests
- _addtionalBuildArguments: /p:ArchiveTests=true
ln -s /usr/local/opt/openssl/lib/pkgconfig/openssl.pc /usr/local/lib/pkgconfig/
displayName: Install Build Dependencies
- - ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- - script: |
- EMSCRIPTEN_VERSION=1.38.47
- git clone https://github.com/emscripten-core/emsdk.git $(EMSDK_PATH)
- cd $(EMSDK_PATH)
- ./emsdk install ${EMSCRIPTEN_VERSION}-upstream
- ./emsdk activate --embedded ${EMSCRIPTEN_VERSION}-upstream
- displayName: Install Emscripten
-
- ${{ if eq(parameters.isOfficialBuild, true) }}:
- template: /eng/pipelines/common/restore-internal-tools.yml
parameters:
- ${{ if eq(parameters.osGroup, 'Android') }}:
- name: osOverride
value: -os Android
+ - ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
+ - name: EMSDK_PATH
+ value: /usr/local/emscripten
+ - name: archType
+ value: wasm
+ - name: osOverride
+ value: '-os WebAssembly'
- ${{ parameters.variables }}
steps:
- Linux_arm
- Linux_arm64
- Linux_musl_x64
+ - WebAssembly_wasm
# - Linux_musl_arm64
- Windows_NT_x64
# - Windows_NT_x86
- Linux_arm
- Linux_arm64
- Linux_musl_x64
+ - WebAssembly_wasm
# - Linux_musl_arm64
- Windows_NT_x64
# - Windows_NT_x86
# - iOS_arm # https://github.com/dotnet/runtime/issues/34465
- iOS_arm64
- iOS_x64
+ - WebAssembly_wasm
jobParameters:
liveRuntimeBuildConfig: release
# - iOS_arm # https://github.com/dotnet/runtime/issues/34465
- iOS_arm64
- iOS_x64
+ - WebAssembly_wasm
jobParameters:
liveRuntimeBuildConfig: debug
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- - WebAssembly_wasm
- ${{ if eq(variables['isFullMatrix'], false) }}:
- Windows_NT_x86
jobParameters:
add_definitions(-DTARGET_32BIT=1)
add_definitions(-DTARGET_X86)
add_definitions(-D_FILE_OFFSET_BITS=64)
+elseif (CLR_CMAKE_TARGET_ARCH_WASM)
+ add_definitions(-DTARGET_32BIT=1)
+ add_definitions(-DTARGET_WASM)
elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DTARGET_64BIT=1)
add_definitions(-DTARGET_ARM64)
project(System.IO.Compression.Native C)
-if (CLR_CMAKE_TARGET_WASM)
+if (CLR_CMAKE_TARGET_ARCH_WASM)
add_definitions(-s USE_ZLIB)
elseif (CLR_CMAKE_TARGET_ANDROID)
# need special case here since we want to link against libz.so but find_package() would resolve libz.a
set(NATIVE_SOURCES ${NATIVE_SOURCES} pal_console.c)
endif ()
-if (CLR_CMAKE_TARGET_LINUX)
+if (CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_ARCH_WASM)
set(NATIVE_SOURCES ${NATIVE_SOURCES} pal_networkchange.c)
if (!HAVE_LINUX_RTNETLINK_H)
return ARCH_ARM64;
#elif defined(TARGET_AMD64)
return ARCH_X64;
-#elif defined(TARGET_X86)
+#elif defined(TARGET_X86) || defined(TARGET_WASM) // TODO: add arch for WASM
return ARCH_X86;
#else
#error Unidentified Architecture
return ARCH_ARM64;
#elif defined(TARGET_AMD64)
return ARCH_X64;
-#elif defined(TARGET_X86)
+#elif defined(TARGET_X86) || defined(TARGET_WASM) // TODO: add arch for WASM
return ARCH_X86;
#else
#error Unidentified Architecture
if (CLR_CMAKE_TARGET_ANDROID)
set(PAL_UNIX_NAME \"ANDROID\")
+elseif (CLR_CMAKE_TARGET_ARCH_WASM)
+ set(PAL_UNIX_NAME \"WEBASSEMBLY\")
elseif (CLR_CMAKE_TARGET_LINUX)
set(PAL_UNIX_NAME \"LINUX\")
elseif (CLR_CMAKE_TARGET_OSX)
set(CMAKE_REQUIRED_INCLUDES ${CROSS_ROOTFS}/usr/local/include)
elseif (CLR_CMAKE_TARGET_NETBSD)
set(PAL_UNIX_NAME \"NETBSD\")
-elseif (CLR_CMAKE_TARGET_ARCH_WASM)
- set(PAL_UNIX_NAME \"WEBASSEMBLY\")
else ()
message(FATAL_ERROR "Unknown platform. Cannot define PAL_UNIX_NAME, used by RuntimeInformation.")
endif ()
set (HAVE_INOTIFY 0)
if (HAVE_INOTIFY_INIT AND HAVE_INOTIFY_ADD_WATCH AND HAVE_INOTIFY_RM_WATCH)
set (HAVE_INOTIFY 1)
-elseif (CLR_CMAKE_TARGET_LINUX)
+elseif (CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_ARCH_WASM)
message(FATAL_ERROR "Cannot find inotify functions on a Linux platform.")
endif()
if [[ "$__BuildArch" == wasm ]]; then
if [[ -z "$EMSDK_PATH" ]]; then
- echo "Error: Should set EMSDK_PATH environment variable pointing to emsdk root."
+ echo "Error: You need to set the EMSDK_PATH environment variable pointing to the emscripten SDK root."
exit 1
fi
source "$EMSDK_PATH"/emsdk_env.sh
+
+ export CLR_CC=$(which emcc)
+ export CLR_CXX=$(which em++)
elif [[ "$__TargetOS" == iOS ]]; then
# nothing to do here
true
<TargetsiOSSimulator Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'x64'">true</TargetsiOSSimulator>
<TargetstvOSSimulator Condition="'$(TargetstvOS)' == 'true' and '$(Platform)' == 'x64'">true</TargetstvOSSimulator>
<TargetsAndroid Condition="'$(TargetOS)' == 'Android'">true</TargetsAndroid>
+ <TargetsWASM Condition="'$(TargetOS)' == 'WebAssembly'">true</TargetsWASM>
<TargetsWindows Condition="'$(TargetOS)' == 'Windows_NT'">true</TargetsWindows>
- <TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'">true</TargetsUnix>
+ <TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsWASM)' == 'true'">true</TargetsUnix>
</PropertyGroup>
<PropertyGroup>
<MonoStaticFileName Condition="'$(TargetsiOS)' == 'true'">libmono.a</MonoStaticFileName>
<MonoStaticFileName Condition="'$(TargetstvOS)' == 'true'">libmono.a</MonoStaticFileName>
<MonoStaticFileName Condition="'$(TargetsAndroid)' == 'true'">libmonosgen-2.0.a</MonoStaticFileName>
+ <MonoFileName Condition="'$(TargetsWASM)' == 'true'">libmono.a</MonoFileName>
+ <MonoStaticFileName Condition="'$(TargetsWASM)' == 'true'">libmono.a</MonoStaticFileName>
<MonoFileName Condition="'$(MonoFileName)' == ''">$(CoreClrFileName)</MonoFileName>
<CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
<LibrariesTestConfig Condition="'$(LibrariesTestConfig)' == ''">$(Configuration)</LibrariesTestConfig>
<_MonoSTRIPOption>STRIP="$(_MonoTuple)-strip"</_MonoSTRIPOption>
</PropertyGroup>
+ <Error Condition="'$(TargetsWASM)' == 'true' and '$(EMSDK_PATH)' == ''" Text="The EMSDK_PATH environment variable should be set pointing to the emscripten SDK root dir."/>
+
+ <!-- WASM specific options -->
+ <ItemGroup Condition="'$(TargetsWASM)' == 'true'">
+ <_MonoConfigureParams Include="--host=wasm32"/>
+ <_MonoConfigureParams Include="--disable-boehm" />
+ <_MonoConfigureParams Include="--disable-btls" />
+ <_MonoConfigureParams Include="--disable-executables" />
+ <_MonoConfigureParams Include="--disable-iconv" />
+ <_MonoConfigureParams Include="--disable-mcs-build" />
+ <_MonoConfigureParams Include="--disable-nls" />
+ <_MonoConfigureParams Include="--disable-visibility-hidden" />
+ <_MonoConfigureParams Include="--enable-maintainer-mode" />
+ <_MonoConfigureParams Include="--enable-llvm-runtime"/>
+ <_MonoConfigureParams Include="--enable-icall-export"/>
+ <_MonoConfigureParams Include="--disable-icall-tables"/>
+ <_MonoConfigureParams Include="--disable-crash-reporting"/>
+ <_MonoConfigureParams Include="--with-bitcode=yes"/>
+ <_MonoConfigureParams Include="--enable-minimal=ssa,com,jit,reflection_emit_save,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,logging,remoting,shared_perfcounters,sgen_debug_helpers,soft_debug,interpreter,assert_messages,cleanup,mdb,gac"/>
+ <!-- FIXME: -Os -->
+ <_MonoCFLAGS Include="-fexceptions" />
+ <_MonoCXXFLAGS Include="-fexceptions -s DISABLE_EXCEPTION_CATCHING=0" />
+ <_MonoAC_VARS Include="ac_cv_func_shm_open_working_with_mmap=no" />
+ </ItemGroup>
+
<!-- Linux options -->
<ItemGroup Condition="'$(TargetsLinux)' == true">
<_MonoCFLAGS Include="-Wl,--build-id" />
<_MonoLDFLAGSOption Condition="@(_MonoLDFLAGS->Count()) > 0">LDFLAGS="@(_MonoLDFLAGS, ' ')"</_MonoLDFLAGSOption>
<_MonoCCLDFLAGSOption Condition="@(_MonoCCLDFLAGS->Count()) > 0">CCLDFLAGS="@(_MonoCCLDFLAGS, ' ')"</_MonoCCLDFLAGSOption>
- <_MonoConfigureCommand>@(_MonoConfigureParams, ' ') @(_MonoAC_VARS, ' ') $(_MonoCFLAGSOption) $(_MonoCXXFLAGSOption) $(_MonoCPPFLAGSOption) $(_MonoCXXCPPFLAGSOption) $(_MonoLDFLAGSOption) $(_MonoCCLDFLAGSOption) $(_MonoCCOption) $(_MonoCXXOption) $(_MonoAROption) $(_MonoASOption) $(_MonoCPPOption) $(_MonoCXXCPPOption) $(_MonoDLLTOOLOption) $(_MonoLDOption) $(_MonoOBJDUMPOption) $(_MonoRANLIBOption) $(_MonoCMAKEOption) $(_MonoSTRIPOption)</_MonoConfigureCommand>
- <_MonoConfigureCommand Condition="'$(_MonoCCOption)' == '' and '$(_MonoCXXOption)' == ''">bash -c 'source $(RepositoryEngineeringDir)native/init-compiler.sh $(Platform) clang && $(MonoProjectRoot)configure $(_MonoConfigureCommand)'</_MonoConfigureCommand>
- <_MonoConfigureCommand Condition="'$(_MonoCCOption)' != '' and '$(_MonoCXXOption)' != ''">$(MonoProjectRoot)configure $(_MonoConfigureCommand)</_MonoConfigureCommand>
+ <_MonoConfigureOptions>@(_MonoConfigureParams, ' ') @(_MonoAC_VARS, ' ') $(_MonoCFLAGSOption) $(_MonoCXXFLAGSOption) $(_MonoCPPFLAGSOption) $(_MonoCXXCPPFLAGSOption) $(_MonoLDFLAGSOption) $(_MonoCCLDFLAGSOption) $(_MonoCCOption) $(_MonoCXXOption) $(_MonoAROption) $(_MonoASOption) $(_MonoCPPOption) $(_MonoCXXCPPOption) $(_MonoDLLTOOLOption) $(_MonoLDOption) $(_MonoOBJDUMPOption) $(_MonoRANLIBOption) $(_MonoCMAKEOption) $(_MonoSTRIPOption)</_MonoConfigureOptions>
+ <_MonoConfigureCommand Condition="'$(_MonoCCOption)' == '' and '$(_MonoCXXOption)' == ''">bash -c 'source $(RepositoryEngineeringDir)native/init-compiler.sh $(Platform) clang && $(MonoProjectRoot)configure $(_MonoConfigureOptions)'</_MonoConfigureCommand>
+ <_MonoConfigureCommand Condition="'$(_MonoCCOption)' != '' and '$(_MonoCXXOption)' != ''">$(MonoProjectRoot)configure $(_MonoConfigureOptions)</_MonoConfigureCommand>
+ <_MonoConfigureCommand Condition="'$(TargetsWASM)' == 'true'">bash -c 'source $(EMSDK_PATH)/emsdk_env.sh && emconfigure $(MonoProjectRoot)configure $(_MonoConfigureOptions)'</_MonoConfigureCommand>
</PropertyGroup>
<!-- AOT cross-compiler specific options -->
<!-- Configure target runtime -->
<MakeDir Directories="$(MonoObjDir)" />
<Message Text="--- Configuring Mono with '$(_MonoConfigureCommand)' ---" Importance="High" />
- <Exec Command="NOCONFIGURE=1 $(MonoProjectRoot)autogen.sh" />
+ <Exec Command="NOCONFIGURE=1 $(MonoProjectRoot)autogen.sh" IgnoreStandardErrorWarningFormat="true"/>
<Exec Command="$(_MonoConfigureCommand)" WorkingDirectory="$(MonoObjDir)" IgnoreStandardErrorWarningFormat="true" />
<Touch Files="$(MonoObjDir)config.h" />
<Target Name="BuildMonoRuntimeUnix" Condition="'$(OS)' != 'Windows_NT'" DependsOnTargets="ConfigureMonoRuntimeUnix">
<Message Text="--- Building Mono ---" Importance="High" />
- <Exec Command="make -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
+ <Exec Condition="'$(TargetsWASM)' != 'true'" Command="make -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
+ <Exec Condition="'$(TargetsWASM)' == 'true'" Command="bash -c 'source $(EMSDK_PATH)/emsdk_env.sh && make -j$([System.Environment]::ProcessorCount)'" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
<Exec Condition="'$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'" Command="make install -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
<Message Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'" Text="--- Building Mono AOT cross-compiler ---" Importance="High" />
<_MonoRuntimeFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetstvOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.so</_MonoRuntimeFilePath>
+ <_MonoRuntimeFilePath Condition="'$(TargetsWASM)' == 'true'">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.a</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.so</_MonoRuntimeFilePath>
<_MonoRuntimeStaticFilePath Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a</_MonoRuntimeStaticFilePath>
<_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm64'">$(MonoObjDir)cross\out\bin\aarch64-darwin-mono-sgen</_MonoAotCrossFilePath>
<Copy SourceFiles="@(_MonoIncludeArtifacts)"
DestinationFiles="@(_MonoIncludeArtifacts->'$(BinDir)include\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
- Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or'$(TargetsAndroid)' == 'true'"/>
+ Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or'$(TargetsAndroid)' == 'true' or '$(TargetsWASM)' == 'true'"/>
<Exec Condition="'$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'" Command="install_name_tool -id @rpath/$(MonoFileName) $(BinDir)$(MonoFileName)" />
</Target>
<!-- Force System.Private.CoreLib.dll into a special IL output directory -->
<OutputPath>$(BinDir)IL/</OutputPath>
<Configurations>Debug;Release;Checked</Configurations>
- <Platforms>x64;x86;arm;arm64;wasm32</Platforms>
+ <Platforms>x64;x86;arm;arm64;wasm</Platforms>
<ILLinkClearInitLocals>true</ILLinkClearInitLocals>
<ILLinkTrimAssembly>true</ILLinkTrimAssembly>
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>TARGET_64BIT;TARGET_ARM64;$(DefineConstants)</DefineConstants>
</PropertyGroup>
- <PropertyGroup Condition="'$(Platform)' == 'wasm32'">
+ <PropertyGroup Condition="'$(Platform)' == 'wasm'">
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>TARGET_32BIT;$(DefineConstants)</DefineConstants>
</PropertyGroup>