Skip to content

Commit

Permalink
Revert "[WASI] use WASI_SDK22_PATH variable (dotnet#104379)"
Browse files Browse the repository at this point in the history
This reverts commit 812cb93.
  • Loading branch information
matouskozak committed Jul 11, 2024
1 parent b5bc2c3 commit 6641e91
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 94 deletions.
13 changes: 6 additions & 7 deletions eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,19 @@ if /i "%__Arch%" == "wasm" (
set __UseEmcmake=1
)
if /i "%__Os%" == "wasi" (
set "__repoRoot=!__repoRoot:\=/!"
if "%WASI_SDK22_PATH%" == "" (
if "%WASI_SDK_PATH%" == "" (
if not exist "%__repoRoot%\src\mono\wasi\wasi-sdk" (
echo Error: Should set WASI_SDK22_PATH environment variable pointing to WASI SDK root.
echo Error: Should set WASI_SDK_PATH environment variable pointing to WASI SDK root.
exit /B 1
)

set "WASI_SDK22_PATH=%__repoRoot%\src\mono\wasi\wasi-sdk"
set "WASI_SDK_PATH=%__repoRoot%\src\mono\wasi\wasi-sdk"
)
:: replace backslash with forward slash and append last slash
set "WASI_SDK22_PATH=!WASI_SDK22_PATH:\=/!"
if not "!WASI_SDK22_PATH:~-1!" == "/" set "WASI_SDK22_PATH=!WASI_SDK22_PATH!/"
set "WASI_SDK_PATH=!WASI_SDK_PATH:\=/!"
if not "!WASI_SDK_PATH:~-1!" == "/" set "WASI_SDK_PATH=!WASI_SDK_PATH!/"
set __CmakeGenerator=Ninja
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK22_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK22_PATH!share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK22_PATH!share/wasi-sysroot"
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK_PATH!/share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK_PATH!/share/wasi-sysroot"
)
) else (
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0"
Expand Down
3 changes: 1 addition & 2 deletions eng/native/gen-buildsys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#

scriptroot="$( cd -P "$( dirname "$0" )" && pwd )"
reporoot="$(cd "$scriptroot"/../..; pwd -P)"

if [[ "$#" -lt 4 ]]; then
echo "Usage..."
Expand Down Expand Up @@ -98,7 +97,7 @@ if [[ "$host_arch" == "wasm" ]]; then
if [[ "$target_os" == "browser" ]]; then
cmake_command="emcmake $cmake_command"
elif [[ "$target_os" == "wasi" ]]; then
cmake_extra_defines="$cmake_extra_defines -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm -DWASI_SDK_PREFIX=$WASI_SDK22_PATH -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK22_PATH}share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=${WASI_SDK22_PATH}share/wasi-sysroot"
true
else
echo "target_os was not specified"
exit 1
Expand Down
3 changes: 1 addition & 2 deletions eng/testing/tests.wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
>true</InstallWasmtimeForTests>

<!--<InstallWorkloadUsingArtifactsDependsOn>_GetWorkloadsToInstall;$(InstallWorkloadUsingArtifactsDependsOn)</InstallWorkloadUsingArtifactsDependsOn>-->
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>

<_BundleAOTTestWasmAppForHelixDependsOn>$(_BundleAOTTestWasmAppForHelixDependsOn);PrepareForWasiBuildApp;_PrepareForAOTOnHelix</_BundleAOTTestWasmAppForHelixDependsOn>
</PropertyGroup>
Expand Down
13 changes: 6 additions & 7 deletions src/libraries/sendtohelix-wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
<IncludeHelixCorrelationPayload>false</IncludeHelixCorrelationPayload>
<EnableDefaultBuildHelixWorkItems>false</EnableDefaultBuildHelixWorkItems>

<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(RepoRoot), 'src', 'mono', 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$(RepoRoot)src\mono\wasi\wasi-sdk\</WASI_SDK_PATH>
<WasiBuildTargetsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasi', 'build'))</WasiBuildTargetsDir>
<WasiSdkDirForHelixPayload>$(HelixDependenciesStagingPath)$(WorkItemPrefix)wasi-sdk</WasiSdkDirForHelixPayload>
<WasmtimeDirForHelixPayload>$(HelixDependenciesStagingPath)$(WorkItemPrefix)wasmtime</WasmtimeDirForHelixPayload>
Expand All @@ -64,7 +63,7 @@
</PropertyGroup>

<ItemGroup>
<HelixDependenciesToStage Condition="'$(NeedsWasiSdk)' == 'true'" SourcePath="$(WASI_SDK22_PATH)" Include="$(WasiSdkDirForHelixPayload)" />
<HelixDependenciesToStage Condition="'$(NeedsWasiSdk)' == 'true'" SourcePath="$(WASI_SDK_PATH)" Include="$(WasiSdkDirForHelixPayload)" />
<HelixDependenciesToStage Condition="'$(NeedsWasmtime)' == 'true'" SourcePath="$(WasmtimeDir)" Include="$(WasmtimeDirForHelixPayload)" />
</ItemGroup>

Expand All @@ -74,7 +73,7 @@
<HelixPreCommand Include="export XHARNESS_LOG_WITH_TIMESTAMPS=true" />
<HelixPreCommand Include="export WASMTIME_BACKTRACE_DETAILS=1" />
<HelixPreCommand Condition="'$(NeedsWasmtime)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/wasmtime:$PATH" />
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/build/wasi-sdk/bin:$PATH" />
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="export PATH=$HELIX_CORRELATION_PAYLOAD/wasi-sdk:$PATH" />
</ItemGroup>

<ItemGroup Condition="'$(WindowsShell)' == 'true'">
Expand All @@ -83,7 +82,7 @@
<HelixPreCommand Include="set XHARNESS_LOG_WITH_TIMESTAMPS=true" />
<HelixPreCommand Include="set WASMTIME_BACKTRACE_DETAILS=1" />
<HelixPreCommand Condition="'$(NeedsWasmtime)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\wasmtime%3B%PATH%" />
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\build\wasi-sdk\bin%3B%PATH%" />
<HelixPreCommand Condition="'$(NeedsWasiSdk)' == 'true'" Include="set PATH=%HELIX_CORRELATION_PAYLOAD%\wasi-sdk%3B%PATH%" />
</ItemGroup>

<PropertyGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
Expand All @@ -93,8 +92,8 @@
</PropertyGroup>

<ItemGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
<HelixPreCommand Condition="'$(WindowsShell)' == 'true'" Include="set &quot;WASI_SDK22_PATH=%HELIX_CORRELATION_PAYLOAD%\build\wasi-sdk&quot;" />
<HelixPreCommand Condition="'$(WindowsShell)' != 'true'" Include="export &quot;WASI_SDK22_PATH=$HELIX_CORRELATION_PAYLOAD/build/wasi-sdk&quot;" />
<HelixPreCommand Condition="'$(WindowsShell)' == 'true'" Include="set &quot;WASI_SDK_PATH=%HELIX_CORRELATION_PAYLOAD%\build\wasi-sdk&quot;" />
<HelixPreCommand Condition="'$(WindowsShell)' != 'true'" Include="export &quot;WASI_SDK_PATH=$HELIX_CORRELATION_PAYLOAD/build/wasi-sdk&quot;" />
</ItemGroup>

<PropertyGroup Condition="'$(NeedsWasiSdk)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
<!--
Helix tasks will attempt to write a .payload file to the payload directory. But if the
directory is not writable, for example when it is a system installed dependency like
`WASI_SDK22_PATH=/usr/local/wasi-sdk`
`WASI_SDK_PATH=/usr/local/wasi-sdk`
.. then we need to stage that before passing the path to helix like under `artifacts/obj/helix-staging`
-->
<Target Name="StageDependenciesForHelix" Condition="@(__HelixDependenciesToStageThatDontExist->Count()) > 0">
Expand Down
11 changes: 7 additions & 4 deletions src/mono/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
<EMSDK_PATH Condition="Exists('$(ProvisionEmscriptenDir)') and '$(EMSDK_PATH)' == ''">$(ProvisionEmscriptenDir.Replace('\', '/'))</EMSDK_PATH>
</PropertyGroup>

<!-- Directory to provision and use WASI sdk if WASI_SDK22_PATH env variable is not set -->
<!-- Directory to provision and use WASI sdk if WASI_SDK_PATH env variable is not set -->
<PropertyGroup Condition="'$(TargetsWasi)' == 'true'">
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
<ShouldProvisionWasiSdk Condition="!Exists($(WASI_SDK22_PATH))">true</ShouldProvisionWasiSdk>
<!-- force download temmporarily https://github.com/dotnet/runtime/issues/101528
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
-->
<WASI_SDK_PATH>$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
<WASI_SDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/'))</WASI_SDK_PATH>
<ShouldProvisionWasiSdk Condition="!Exists($(_ProvisionWasiSdkDir))">true</ShouldProvisionWasiSdk>
</PropertyGroup>

<PropertyGroup>
Expand Down
37 changes: 10 additions & 27 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<Error Condition="('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true') and !$([MSBuild]::IsOSPlatform('OSX'))" Text="Error: $(TargetOS) can only be built on macOS." />
<Error Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(Platform)' != 'x64' and '$(Platform)' != 'x86' and '$(Platform)' != 'arm64' and '$(Platform)' != 'arm'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
<Error Condition="'$(TargetsBrowser)' == 'true' and '$(EMSDK_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The EMSDK_PATH environment variable should be set pointing to the emscripten SDK root dir."/>
<Error Condition="'$(TargetsWasi)' == 'true' and '$(WASI_SDK22_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The WASI_SDK22_PATH environment variable should be set pointing to the WASI SDK root dir."/>
<Error Condition="'$(TargetsWasi)' == 'true' and '$(WASI_SDK_PATH)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="The WASI_SDK_PATH environment variable should be set pointing to the WASI SDK root dir."/>
<Error Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(ANDROID_NDK_ROOT)' == '' and '$(SkipMonoCrossJitConfigure)' != 'true'" Text="Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root." />
<Error Condition="'$(HostOS)' == 'windows' and ('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true')" Text="Error: Mono runtime for $(TargetOS) can't be built on Windows." />

Expand Down Expand Up @@ -302,7 +302,7 @@ JS_ENGINES = [NODE_JS]
</PropertyGroup>
</Target>

<!-- Sets up WASI SDK if you don't have the WASI_SDK22_PATH env variable set -->
<!-- Sets up WASI SDK if you don't have the WASI_SDK_PATH env variable set -->
<Target Name="ProvisionWasiSdk"
Condition="'$(ShouldProvisionWasiSdk)' == 'true' and '$(SkipMonoCrossJitConfigure)' != 'true'">
<ReadLinesFromFile File="$(MSBuildThisFileDirectory)/wasi/wasi-sdk-version.txt">
Expand All @@ -317,36 +317,20 @@ JS_ENGINES = [NODE_JS]
<WasiSdkUrl Condition="'$(HostOS)' == 'windows'" >https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion)/wasi-sdk-$(WasiSdkVersion).0.m-mingw.tar.gz</WasiSdkUrl>
</PropertyGroup>

<RemoveDir Directories="$(WASI_SDK22_PATH)" />
<Exec Command="curl -L -o wasi-sdk-$(WasiSdkVersion).0.tar.gz $(WasiSdkUrl) &amp;&amp; mkdir -p $(WASI_SDK22_PATH) &amp;&amp; tar --strip-components=1 -xzf wasi-sdk-$(WasiSdkVersion).0.tar.gz -C $(WASI_SDK22_PATH) &amp;&amp; cp $(WasiLocalPath)/wasi-sdk-version.txt $(WASI_SDK22_PATH)wasi-sdk-version.txt"
<RemoveDir Directories="$(WASI_SDK_PATH)" />
<Exec Command="curl -L -o wasi-sdk-$(WasiSdkVersion).0.tar.gz $(WasiSdkUrl) &amp;&amp; mkdir -p $(WASI_SDK_PATH) &amp;&amp; tar --strip-components=1 -xzf wasi-sdk-$(WasiSdkVersion).0.tar.gz -C $(WASI_SDK_PATH) &amp;&amp; cp $(WasiLocalPath)/wasi-sdk-version.txt $(WASI_SDK_PATH)/wasi-sdk-version.txt"
Condition="'$(HostOS)' != 'windows'"
WorkingDirectory="$(ArtifactsObjDir)"
IgnoreStandardErrorWarningFormat="true" />

<!--
Temporary WASI-SDK 22 workaround #2: The version of `wasm-component-ld` that
ships with WASI-SDK 22 contains a
[bug](https://github.com/bytecodealliance/wasm-component-ld/issues/22) which
has been fixed in a v0.5.3 of that utility, so we upgrade it here.
-->
<Exec Command="curl -L -o wasm-component-ld-v0.5.4-x86_64-linux.tar.gz https://github.com/bytecodealliance/wasm-component-ld/releases/download/v0.5.4/wasm-component-ld-v0.5.4-x86_64-linux.tar.gz &amp;&amp; mkdir -p $(WASI_SDK22_PATH)wasm-component &amp;&amp; tar --strip-components=1 -xzf wasm-component-ld-v0.5.4-x86_64-linux.tar.gz -C $(WASI_SDK22_PATH)wasm-component &amp;&amp; cp $(WASI_SDK22_PATH)wasm-component/wasm-component-ld $(WASI_SDK22_PATH)bin/wasm-component-ld"
Condition="'$(HostOS)' != 'windows'"
WorkingDirectory="$(ArtifactsObjDir)"
IgnoreStandardErrorWarningFormat="true" />

<Exec Command="powershell -NonInteractive -command &quot;&amp; $(WasiLocalPath)\provision.ps1 -WasiSdkUrl $(WasiSdkUrl) -WasiSdkVersion $(WasiSdkVersion) -WasiSdkPath $(WASI_SDK22_PATH) -WasiLocalPath $(WasiLocalPath); Exit $LastExitCode &quot;"
<Exec Command="powershell -NonInteractive -command &quot;&amp; $(WasiLocalPath)\provision.ps1 -WasiSdkUrl $(WasiSdkUrl) -WasiSdkVersion $(WasiSdkVersion) -WasiSdkPath $(WASI_SDK_PATH) -WasiLocalPath $(WasiLocalPath); Exit $LastExitCode &quot;"
Condition="'$(HostOS)' == 'windows'"
WorkingDirectory="$(ArtifactsObjDir)"
IgnoreStandardErrorWarningFormat="true" />

<Copy SourceFiles="$(MSBuildThisFileDirectory)/wasi/wasi-sdk/share/wasi-sysroot/include/wasm32-wasi-threads/pthread.h"
DestinationFiles="$(MSBuildThisFileDirectory)/wasi/wasi-sdk/share/wasi-sysroot/include/wasm32-wasip2/pthread.h"
/>

</Target>

<Target Name="ValidateWasiSdk" Condition="'$(SkipMonoCrossJitConfigure)' != 'true'">
<ReadLinesFromFile File="$(WASI_SDK22_PATH)wasi-sdk-version.txt">
<ReadLinesFromFile File="$(WASI_SDK_PATH)/wasi-sdk-version.txt">
<Output TaskParameter="Lines" ItemName="_ActualVersionLines" />
</ReadLinesFromFile>
<ReadLinesFromFile File="$(MSBuildThisFileDirectory)/wasi/wasi-sdk-version.txt">
Expand All @@ -356,7 +340,7 @@ JS_ENGINES = [NODE_JS]
<ActualWasiSdkVersion>%(_ActualVersionLines.Identity)</ActualWasiSdkVersion>
<ExpectedWasiSdkVersion>%(_ExpectedVersionLines.Identity)</ExpectedWasiSdkVersion>
</PropertyGroup>
<Error Text="Expected version: %(_ExpectedVersionLines.Identity) and actual version: %(_ActualVersionLines.Identity) of WASI SDK does not match. Please delete $(WASI_SDK22_PATH) folder to provision a new version."
<Error Text="Expected version: %(_ExpectedVersionLines.Identity) and actual version: %(_ActualVersionLines.Identity) of WASI SDK does not match. Please delete $(WASI_SDK_PATH) folder to provision a new version."
Condition="'$(ActualWasiSdkVersion)' != '$(ExpectedWasiSdkVersion)'" />
</Target>

Expand Down Expand Up @@ -738,14 +722,13 @@ JS_ENGINES = [NODE_JS]

<PropertyGroup>
<EMSDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(EMSDK_PATH)').Replace('\', '/'))</EMSDK_PATH>
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
<WASI_SDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/'))</WASI_SDK_PATH>
<_EmsdkEnvScriptPath>$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env$(ScriptExt)'))</_EmsdkEnvScriptPath>

<_MonoCMakeConfigureCommand>cmake @(_MonoCMakeArgs, ' ') $(MonoCMakeExtraArgs) &quot;$(MonoProjectRoot.TrimEnd('\/'))&quot;</_MonoCMakeConfigureCommand>
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true' and '$(_MonoSkipInitCompiler)' != 'true' and '$(HostOS)' != 'windows'">sh -c 'build_arch=&quot;$(_CompilerTargetArch)&quot; compiler=&quot;$(MonoCCompiler)&quot; . &quot;$(RepositoryEngineeringCommonDir)native/init-compiler.sh&quot; &amp;&amp; @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)'</_MonoCMakeConfigureCommand>
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true' and '$(_MonoSkipInitCompiler)' == 'true' and '$(HostOS)' != 'windows'">$(_MonoCCOption) $(_MonoCXXOption) @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)</_MonoCMakeConfigureCommand>
<_MonoCMakeConfigureCommand Condition="'$(TargetsWasi)' == 'true'">$(_MonoCMakeConfigureCommand) -DWASI_SDK_PREFIX=$(WASI_SDK22_PATH) -DCMAKE_SYSROOT=$(WASI_SDK22_PATH)share/wasi-sysroot -DCMAKE_TOOLCHAIN_FILE=$(WASI_SDK22_PATH)share/cmake/wasi-sdk.cmake -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK22_PATH)share/wasi-sysroot"</_MonoCMakeConfigureCommand>
<_MonoCMakeConfigureCommand Condition="'$(TargetsWasi)' == 'true'">$(_MonoCMakeConfigureCommand) -DWASI_SDK_PREFIX=$(WASI_SDK_PATH) -DCMAKE_SYSROOT=$(WASI_SDK_PATH)share/wasi-sysroot -DCMAKE_TOOLCHAIN_FILE=$(WASI_SDK_PATH)share/cmake/wasi-sdk.cmake -DCMAKE_CXX_FLAGS="--sysroot=$(WASI_SDK_PATH)share/wasi-sysroot"</_MonoCMakeConfigureCommand>

<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(TargetsWasi)' != 'true' and '$(HostOS)' == 'windows'">call &quot;$(RepositoryEngineeringDir)native\init-vs-env.cmd&quot; $(_CompilerTargetArch) &amp;&amp; cd /D &quot;$(MonoObjDir)&quot; &amp;&amp; @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)</_MonoCMakeConfigureCommand>
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' == 'true' and '$(HostOS)' != 'windows'">bash -c 'source $(_EmsdkEnvScriptPath) 2>&amp;1 &amp;&amp; emcmake $(_MonoCMakeConfigureCommand)'</_MonoCMakeConfigureCommand>
Expand Down Expand Up @@ -941,7 +924,7 @@ JS_ENGINES = [NODE_JS]
<MonoAotCrossOffsetsToolParams Condition="'$(MonoAotOffsetsPrefix)' != ''" Include="--prefix=&quot;$(MonoAotOffsetsPrefix)&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(MonoAotCMakeSysroot)' != ''" Include="--sysroot=&quot;$(MonoAotCMakeSysroot)&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsBrowser)' == 'true'" Include="--emscripten-sdk=&quot;$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emscripten').TrimEnd('\/'))&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsWasi)' == 'true'" Include="--sysroot=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK22_PATH)', 'share/wasi-sysroot'))&quot; --wasi-sdk=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK22_PATH)').TrimEnd('\/'))&quot;" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsWasi)' == 'true'" Include="--sysroot=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)', 'share/wasi-sysroot'))&quot; --wasi-sdk=&quot;$([MSBuild]::NormalizePath('$(WASI_SDK_PATH)').TrimEnd('\/'))&quot;" />
</ItemGroup>

<!--
Expand Down
Loading

0 comments on commit 6641e91

Please sign in to comment.