native: get Windows LLVM toolchain from Stride.Dependencies.LLVM.Windows, drop deps/LLVM (540MB of LFS)

This commit is contained in:
Virgile Bello
2026-06-12 14:14:57 +09:00
parent 64d2db660b
commit cf9c8d8f28
19 changed files with 24 additions and 83 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ inputs:
description: Ref to check out (passed to actions/checkout)
default: ''
exclude:
description: 'Comma-separated repo dirs to drop from the working tree and LFS fetch (empty = full checkout). Typical: samples,deps/LLVM — deps/LLVM is only used by Windows-host native builds.'
description: 'Comma-separated repo dirs to drop from the working tree and LFS fetch (empty = full checkout).'
default: ''
fetch-depth:
description: Passed to actions/checkout
+1 -1
View File
@@ -108,7 +108,7 @@ jobs:
- uses: ./.github/actions/stride-checkout
with:
ref: ${{ (github.event.inputs.commit-sha != '' && github.event.inputs.commit-sha) || (inputs.commit-sha != '' && inputs.commit-sha) || (github.event.client_payload.pr_number && format('refs/pull/{0}/merge', github.event.client_payload.pr_number)) || github.ref }}
exclude: samples,deps/LLVM
exclude: samples
- uses: actions/setup-dotnet@v4
with:
+1 -1
View File
@@ -101,7 +101,7 @@ jobs:
- uses: ./.github/actions/stride-checkout
with:
ref: ${{ (github.event.inputs.commit-sha != '' && github.event.inputs.commit-sha) || (inputs.commit-sha != '' && inputs.commit-sha) || (github.event.client_payload.pr_number && format('refs/pull/{0}/merge', github.event.client_payload.pr_number)) || github.ref }}
exclude: samples,deps/LLVM
exclude: samples
- uses: actions/setup-dotnet@v4
with:
+1 -1
View File
@@ -84,7 +84,7 @@ jobs:
- uses: ./.github/actions/stride-checkout
with:
ref: ${{ (github.event.inputs.commit-sha != '' && github.event.inputs.commit-sha) || (inputs.commit-sha != '' && inputs.commit-sha) || (github.event.client_payload.pr_number && format('refs/pull/{0}/merge', github.event.client_payload.pr_number)) || github.ref }}
exclude: samples,deps/LLVM
exclude: samples
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
+1 -1
View File
@@ -80,7 +80,7 @@ jobs:
- uses: ./.github/actions/stride-checkout
with:
ref: ${{ (github.event.inputs.commit-sha != '' && github.event.inputs.commit-sha) || (inputs.commit-sha != '' && inputs.commit-sha) || (github.event.client_payload.pr_number && format('refs/pull/{0}/merge', github.event.client_payload.pr_number)) || github.ref }}
exclude: samples,deps/LLVM
exclude: samples
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
+1 -5
View File
@@ -21,13 +21,9 @@ jobs:
name: Refresh tests/Stride.Samples.Tests baselines
runs-on: ubuntu-latest
steps:
# Bootstrap .github so the local composite action below is resolvable pre-checkout.
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- uses: ./.github/actions/stride-checkout
with:
exclude: deps/LLVM
lfs: true
# Need full history for the auto-generated branch name to be stable.
fetch-depth: 0
@@ -94,15 +94,11 @@ jobs:
STRIDE_TESTS_CRASH_DUMPS: "1"
STRIDE_TESTS_CRASH_DUMP_DIR: "${{ github.workspace }}/crash-dumps"
steps:
# Bootstrap .github so the local composite action below is resolvable pre-checkout.
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- uses: ./.github/actions/stride-checkout
with:
lfs: true
submodules: true
ref: ${{ (github.event.inputs.commit-sha != '' && github.event.inputs.commit-sha) || (github.event.client_payload.pr_number && format('refs/pull/{0}/merge', github.event.client_payload.pr_number)) || github.ref }}
# Windows legs build native code with deps/LLVM; the Linux leg doesn't need it.
exclude: ${{ matrix.platform == 'Linux' && 'deps/LLVM' || '' }}
- uses: actions/setup-dotnet@v4
with:
-37
View File
@@ -1,37 +0,0 @@
# LLVM Toolchain
Pre-built LLVM binaries used for native C/C++ compilation in Stride.
## Version
**LLVM 22.1.2** (March 2026)
Source: https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.2
Package: `clang+llvm-22.1.2-x86_64-pc-windows-msvc.tar.xz`
## Binaries
| File | Purpose |
|------|---------|
| `clang.exe` | C/C++ compiler |
| `clang-cl.exe` | MSVC-compatible C/C++ compiler driver |
| `lld.exe` | Generic linker |
| `lld-link.exe` | Windows MSVC linker (lld with COFF flavor) |
| `ld.lld.exe` | Unix/ELF linker (lld with ELF flavor) |
| `ld64.lld.exe` | macOS linker (lld with Mach-O flavor, replaces old darwin_ld) |
| `lipo.exe` | Universal binary tool (llvm-lipo, replaces old Apple lipo) |
| `llvm-ar.exe` | Archive/static library tool |
## Usage
- **Windows native build**: `clang.exe` + `lld-link.exe` (via `-fuse-ld=lld`)
- **Linux cross-compilation**: `clang.exe` + `ld.lld.exe`
- **macOS cross-compilation**: `clang.exe` + `ld64.lld.exe`
- **iOS cross-compilation**: `clang.exe` + `llvm-ar.exe` + `lipo.exe`
## Upgrading
1. Download the latest `clang+llvm-*-x86_64-pc-windows-msvc.tar.xz` from https://github.com/llvm/llvm-project/releases
2. Extract and copy `clang.exe`, `clang-cl.exe`, `lld.exe`, `lld-link.exe`, `ld.lld.exe`, `ld64.lld.exe`, `llvm-ar.exe` to this directory
3. Copy `llvm-lipo.exe` as `lipo.exe`
4. Update this README with the new version
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac210a076eadbb97f111189a8418665209c3640949505e482062f7bd2f30fbcf
size 108426240
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac210a076eadbb97f111189a8418665209c3640949505e482062f7bd2f30fbcf
size 108426240
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
size 72396288
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
size 72396288
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:19dd89f7071e02c92ef310817bb204894a4cf72fe7a8dd7745000ebe24e9813d
size 18330112
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
size 72396288
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
size 72396288
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6b0e78a7019401d9e0de603f52d1cced70ae4e47b486ca7f0aa9ae564836fba5
size 18496000
+1
View File
@@ -114,6 +114,7 @@
<PackageVersion Include="Stride.Dependencies.SpirvCross" Version="2026.4.26" />
<PackageVersion Include="Stride.Dependencies.SPIRVTools" Version="2026.6.3" />
<PackageVersion Include="Stride.Dependencies.Lavapipe" Version="2026.5.30" />
<PackageVersion Include="Stride.Dependencies.LLVM.Windows" Version="2026.6.11" />
</ItemGroup>
<!-- Avalonia dependencies -->
<PropertyGroup>
+10 -6
View File
@@ -15,11 +15,15 @@
<!--Use "-v" to debug the tooling -->
<StrideNativeToolingDebug></StrideNativeToolingDebug>
<!-- Windows hosts get the toolchain from Stride.Dependencies.LLVM.Windows (referenced
in Stride.Build.Sdk); other hosts use the system clang/lld. -->
<StrideNativeLlvmDir Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(PkgStride_Dependencies_LLVM_Windows)\tools\win-x64\</StrideNativeLlvmDir>
<StrideNativeLldCommand>lld</StrideNativeLldCommand>
<StrideNativeLldCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(MSBuildThisFileDirectory)..\..\deps\\LLVM\lld.exe</StrideNativeLldCommand>
<StrideNativeLldCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(StrideNativeLlvmDir)lld.exe</StrideNativeLldCommand>
<StrideNativeClangCommand>clang</StrideNativeClangCommand>
<StrideNativeClangCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(MSBuildThisFileDirectory)..\..\deps\\LLVM\clang.exe</StrideNativeClangCommand>
<StrideNativeClangCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(StrideNativeLlvmDir)clang.exe</StrideNativeClangCommand>
<!-- ar produces the static archives (.a) consumed by the iOS app linker.
macOS/Linux use system ar (BSD-format on macOS, but the Apple linker only
@@ -27,7 +31,7 @@
llvm-ar with the bsd format flag to match. -->
<StrideNativeArCommand>ar</StrideNativeArCommand>
<StrideNativeArArgs>rcs</StrideNativeArArgs>
<StrideNativeArCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(MSBuildThisFileDirectory)..\..\deps\\LLVM\llvm-ar.exe</StrideNativeArCommand>
<StrideNativeArCommand Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(StrideNativeLlvmDir)llvm-ar.exe</StrideNativeArCommand>
<StrideNativeArArgs Condition="$([MSBuild]::IsOSPlatform('Windows'))">rcs --format bsd</StrideNativeArArgs>
<StrideNativeClang>$(StrideNativeToolingDebug) -Wno-ignored-attributes -Wno-delete-non-virtual-dtor -Wno-macro-redefined -I&quot;$(MSBuildThisFileDirectory)..\..\deps\\NativePath&quot; -I&quot;$(MSBuildThisFileDirectory)..\..\deps\\NativePath\standard&quot;</StrideNativeClang>
@@ -182,11 +186,11 @@
<Target Name="CompileNativeClang_UWP" Inputs="@(StrideNativeCFile);@(StrideNativeHFile)" Outputs="@(StrideNativeOutput)" Condition="'$(TargetFramework)' == '$(StrideFrameworkUWP)' And $(DesignTimeBuild) != true And $(BuildingProject) != false" BeforeTargets="CoreCompile" DependsOnTargets="_StrideRegisterNativeOutputs">
<MakeDir Directories="$(OutputObjectPath)\x64"/>
<Exec Command="&quot;$(MSBuildThisFileDirectory)..\..\deps\\LLVM\clang-cl.exe&quot; $(StrideNativeClang) -DNEED_DLL_EXPORT -o &quot;$(OutputObjectPath)\x64\%(StrideNativeCFile.Filename).obj&quot; -c &quot;%(StrideNativeCFile.FullPath)&quot; -WX -GS- -MD -DUWP -m64" />
<Exec Command="&quot;$(StrideNativeClangCommand)&quot; --driver-mode=cl $(StrideNativeClang) -DNEED_DLL_EXPORT -o &quot;$(OutputObjectPath)\x64\%(StrideNativeCFile.Filename).obj&quot; -c &quot;%(StrideNativeCFile.FullPath)&quot; -WX -GS- -MD -DUWP -m64" />
<MSBuild Projects="$(MSBuildThisFileDirectory)WindowsProjects\UWP\UWP.vcxproj" Targets="Build" Properties="StrideNativeOutputName=$(StrideNativeOutputName);StrideNativeOutputDir=$(StrideNativeOutputPath)\x64;StrideDependenciesDir=$(MSBuildThisFileDirectory)..\..\deps\;StrideNativePathLibs=libNativePath.lib $(StrideNativePathLibsUWP);StrideNativeProjectFolder=$(ProjectDir);StrideNativeProjectObjFolder=$(OutputObjectPath)\x64;Configuration=$(Configuration);Platform=x64" StopOnFirstFailure="true" />
<MakeDir Directories="$(OutputObjectPath)\ARM"/>
<Exec Command="&quot;$(MSBuildThisFileDirectory)..\..\deps\\LLVM\clang-cl.exe&quot; $(StrideNativeClang) -DNEED_DLL_EXPORT -o &quot;$(OutputObjectPath)\ARM\%(StrideNativeCFile.Filename).obj&quot; -c &quot;%(StrideNativeCFile.FullPath)&quot; -WX -GS- -MD -DUWP -m32 --target=thumbv7-windows-msvc" />
<Exec Command="&quot;$(StrideNativeClangCommand)&quot; --driver-mode=cl $(StrideNativeClang) -DNEED_DLL_EXPORT -o &quot;$(OutputObjectPath)\ARM\%(StrideNativeCFile.Filename).obj&quot; -c &quot;%(StrideNativeCFile.FullPath)&quot; -WX -GS- -MD -DUWP -m32 --target=thumbv7-windows-msvc" />
<MSBuild Projects="$(MSBuildThisFileDirectory)WindowsProjects\UWP\UWP.vcxproj" Targets="Build" Properties="StrideNativeOutputName=$(StrideNativeOutputName);StrideNativeOutputDir=$(StrideNativeOutputPath)\ARM;StrideDependenciesDir=$(MSBuildThisFileDirectory)..\..\deps\;StrideNativePathLibs=libNativePath.lib $(StrideNativePathLibsUWP);StrideNativeProjectFolder=$(ProjectDir);StrideNativeProjectObjFolder=$(OutputObjectPath)\ARM;Configuration=$(Configuration);Platform=ARM" StopOnFirstFailure="true" />
</Target>
@@ -313,7 +317,7 @@
<MakeDir Directories="$(StrideNativeOutputPath)\runtimes\osx-x64\native"/>
<Exec Condition="'%(StrideNativeCFile.Extension)' != '.cpp'" Command="&quot;$(StrideNativeClangCommand)&quot; $(StrideNativeClang) -DPLATFORM_MACOS -o &quot;$(OutputObjectPath)\osx-x64\%(StrideNativeCFile.Filename)_x64.o&quot; -c &quot;%(StrideNativeCFile.FullPath)&quot; -fPIC -target x86_64-apple-darwin" />
<Exec Condition="'%(StrideNativeCFile.Extension)' == '.cpp'" Command="&quot;$(StrideNativeClangCommand)&quot; $(StrideNativeClangCPP) $(StrideNativeClang) -DPLATFORM_MACOS -o &quot;$(OutputObjectPath)\osx-x64\%(StrideNativeCFile.Filename)_x64.o&quot; -c &quot;%(StrideNativeCFile.FullPath)&quot; -fPIC -target x86_64-apple-darwin" />
<Exec Command="&quot;$(MSBuildThisFileDirectory)..\..\deps\\LLVM\ld64.lld.exe&quot; -arch x86_64 -w -flat_namespace -undefined dynamic_lookup -platform_version macos 10.11 10.11 -dylib -o &quot;$(StrideNativeOutputPath)\runtimes\osx-x64\native\$(StrideNativeOutputName).dylib&quot; @(StrideNativeCFile->'&quot;$(OutputObjectPath)\osx-x64\%(Filename)_x64.o&quot;', ' ') @(StrideNativePathLibsmacOS->'&quot;$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\%(Filename).a&quot;', ' ') &quot;$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\libNativePath.a&quot;" />
<Exec Command="&quot;$(StrideNativeLldCommand)&quot; -flavor darwin -arch x86_64 -w -flat_namespace -undefined dynamic_lookup -platform_version macos 10.11 10.11 -dylib -o &quot;$(StrideNativeOutputPath)\runtimes\osx-x64\native\$(StrideNativeOutputName).dylib&quot; @(StrideNativeCFile->'&quot;$(OutputObjectPath)\osx-x64\%(Filename)_x64.o&quot;', ' ') @(StrideNativePathLibsmacOS->'&quot;$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\%(Filename).a&quot;', ' ') &quot;$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\libNativePath.a&quot;" />
</Target>
@@ -105,6 +105,11 @@
<!-- Native C/C++ compilation (when StrideNativeOutputName is set) -->
<Import Condition="'$(StrideNativeOutputName)' != ''" Project="$(StrideRoot)sources\native\Stride.Native.targets" />
<!-- LLVM toolchain for Windows hosts; build-time only, never a package dependency. -->
<ItemGroup Condition="'$(StrideNativeOutputName)' != '' And $([MSBuild]::IsOSPlatform('Windows'))">
<PackageReference Include="Stride.Dependencies.LLVM.Windows" GeneratePathProperty="true" PrivateAssets="all" />
</ItemGroup>
<!-- ================================================================ -->
<!-- Shader Code Generation Support -->
<!-- ================================================================ -->