Skip to content

Commit 17a67bd

Browse files
committed
native: auto-disable win-arm64 in clang mode when VS arm64 toolset is absent
1 parent d9b9c7b commit 17a67bd

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

sources/native/Stride.Native.targets

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@
2727
<!--<StrideNativeOutputPath>$([MSBuild]::MakeRelative('$(OutputPath)', '$(StridePackageStridePlatformBin)\'))</StrideNativeOutputPath>-->
2828
<AllowedOutputExtensionsInPackageBuildOutputFolder>.so; .a; $(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder>
2929

30-
<!-- Auto-disable Windows ARM64 native build in MSVC mode if the VS ARM64 toolset isn't installed.
31-
Clang mode always supports ARM64 via bundled clang+lld targeting aarch64-pc-windows-msvc. -->
30+
<!-- Auto-disable Windows ARM64 native build if the VS ARM64 toolset isn't installed.
31+
MSVC mode: check VCToolsInstallDir for arm64 cl.exe (env var set by Dev Cmd / vcvarsall).
32+
Clang mode: probe standard VS install paths for arm64 CRT libs (no env var available). -->
3233
<_StrideArm64ToolsetMissing Condition="'$(StrideNativeWindowsArm64Enabled)' == '' And '$(StrideNativeBuildModeMSVC)' == 'true' And !Exists('$(VCToolsInstallDir)bin\Hostx64\arm64\cl.exe')">true</_StrideArm64ToolsetMissing>
34+
</PropertyGroup>
35+
36+
<ItemGroup Condition="'$(StrideNativeWindowsArm64Enabled)' == '' And '$(StrideNativeBuildModeClang)' == 'true' And $([MSBuild]::IsOSPlatform('Windows'))">
37+
<_StrideArm64LibProbe Include="$(MSBuildProgramFiles32)\Microsoft Visual Studio\*\*\VC\Tools\MSVC\*\lib\arm64\msvcrt.lib" />
38+
<_StrideArm64LibProbe Include="$(ProgramW6432)\Microsoft Visual Studio\*\*\VC\Tools\MSVC\*\lib\arm64\msvcrt.lib" />
39+
</ItemGroup>
40+
41+
<PropertyGroup>
42+
<_StrideArm64LibProbeJoined>@(_StrideArm64LibProbe)</_StrideArm64LibProbeJoined>
43+
<_StrideArm64ToolsetMissing Condition="'$(StrideNativeWindowsArm64Enabled)' == '' And '$(StrideNativeBuildModeClang)' == 'true' And $([MSBuild]::IsOSPlatform('Windows')) And '$(_StrideArm64LibProbeJoined)' == ''">true</_StrideArm64ToolsetMissing>
3344
<StrideNativeWindowsArm64Enabled Condition="'$(StrideNativeWindowsArm64Enabled)' == '' And '$(_StrideArm64ToolsetMissing)' == 'true'">false</StrideNativeWindowsArm64Enabled>
3445
<StrideNativeWindowsArm64Enabled Condition="'$(StrideNativeWindowsArm64Enabled)' == ''">true</StrideNativeWindowsArm64Enabled>
3546
</PropertyGroup>
3647

3748
<Target Name="_StrideWarnArm64ToolsetMissing" BeforeTargets="Build" Condition="'$(_StrideArm64ToolsetMissing)' == 'true' And '$(StrideNativeOutputName)' != ''">
38-
<Warning Text="[Stride] Windows ARM64 native build skipped: MSVC ARM64 toolset (cl.exe) not found under '$(VCToolsInstallDir)bin\Hostx64\arm64\'. Install 'MSVC v145 ARM64/ARM64EC build tools' from the VS installer, or set -p:StrideNativeWindowsArm64Enabled=false to silence this warning." />
49+
<Warning Text="[Stride] Windows ARM64 native build skipped: MSVC ARM64 toolset not found. Install 'MSVC v145 ARM64/ARM64EC build tools' from the VS installer, or set -p:StrideNativeWindowsArm64Enabled=false to silence this warning." />
3950
</Target>
4051

4152
<Choose>

0 commit comments

Comments
 (0)