mirror of
https://github.com/stride3d/stride.git
synced 2026-10-12 02:23:23 +00:00
native: get Windows LLVM toolchain from Stride.Dependencies.LLVM.Windows, drop deps/LLVM (540MB of LFS)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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:
|
||||
|
||||
Vendored
-37
@@ -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
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac210a076eadbb97f111189a8418665209c3640949505e482062f7bd2f30fbcf
|
||||
size 108426240
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac210a076eadbb97f111189a8418665209c3640949505e482062f7bd2f30fbcf
|
||||
size 108426240
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
|
||||
size 72396288
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
|
||||
size 72396288
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:19dd89f7071e02c92ef310817bb204894a4cf72fe7a8dd7745000ebe24e9813d
|
||||
size 18330112
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
|
||||
size 72396288
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24b8e2d4efc663728abafa6d4cfb453aef34e7e303d8d6a3c0825ccd2e781c4c
|
||||
size 72396288
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b0e78a7019401d9e0de603f52d1cced70ae4e47b486ca7f0aa9ae564836fba5
|
||||
size 18496000
|
||||
@@ -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>
|
||||
|
||||
@@ -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"$(MSBuildThisFileDirectory)..\..\deps\\NativePath" -I"$(MSBuildThisFileDirectory)..\..\deps\\NativePath\standard"</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=""$(MSBuildThisFileDirectory)..\..\deps\\LLVM\clang-cl.exe" $(StrideNativeClang) -DNEED_DLL_EXPORT -o "$(OutputObjectPath)\x64\%(StrideNativeCFile.Filename).obj" -c "%(StrideNativeCFile.FullPath)" -WX -GS- -MD -DUWP -m64" />
|
||||
<Exec Command=""$(StrideNativeClangCommand)" --driver-mode=cl $(StrideNativeClang) -DNEED_DLL_EXPORT -o "$(OutputObjectPath)\x64\%(StrideNativeCFile.Filename).obj" -c "%(StrideNativeCFile.FullPath)" -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=""$(MSBuildThisFileDirectory)..\..\deps\\LLVM\clang-cl.exe" $(StrideNativeClang) -DNEED_DLL_EXPORT -o "$(OutputObjectPath)\ARM\%(StrideNativeCFile.Filename).obj" -c "%(StrideNativeCFile.FullPath)" -WX -GS- -MD -DUWP -m32 --target=thumbv7-windows-msvc" />
|
||||
<Exec Command=""$(StrideNativeClangCommand)" --driver-mode=cl $(StrideNativeClang) -DNEED_DLL_EXPORT -o "$(OutputObjectPath)\ARM\%(StrideNativeCFile.Filename).obj" -c "%(StrideNativeCFile.FullPath)" -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=""$(StrideNativeClangCommand)" $(StrideNativeClang) -DPLATFORM_MACOS -o "$(OutputObjectPath)\osx-x64\%(StrideNativeCFile.Filename)_x64.o" -c "%(StrideNativeCFile.FullPath)" -fPIC -target x86_64-apple-darwin" />
|
||||
<Exec Condition="'%(StrideNativeCFile.Extension)' == '.cpp'" Command=""$(StrideNativeClangCommand)" $(StrideNativeClangCPP) $(StrideNativeClang) -DPLATFORM_MACOS -o "$(OutputObjectPath)\osx-x64\%(StrideNativeCFile.Filename)_x64.o" -c "%(StrideNativeCFile.FullPath)" -fPIC -target x86_64-apple-darwin" />
|
||||
<Exec Command=""$(MSBuildThisFileDirectory)..\..\deps\\LLVM\ld64.lld.exe" -arch x86_64 -w -flat_namespace -undefined dynamic_lookup -platform_version macos 10.11 10.11 -dylib -o "$(StrideNativeOutputPath)\runtimes\osx-x64\native\$(StrideNativeOutputName).dylib" @(StrideNativeCFile->'"$(OutputObjectPath)\osx-x64\%(Filename)_x64.o"', ' ') @(StrideNativePathLibsmacOS->'"$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\%(Filename).a"', ' ') "$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\libNativePath.a"" />
|
||||
<Exec Command=""$(StrideNativeLldCommand)" -flavor darwin -arch x86_64 -w -flat_namespace -undefined dynamic_lookup -platform_version macos 10.11 10.11 -dylib -o "$(StrideNativeOutputPath)\runtimes\osx-x64\native\$(StrideNativeOutputName).dylib" @(StrideNativeCFile->'"$(OutputObjectPath)\osx-x64\%(Filename)_x64.o"', ' ') @(StrideNativePathLibsmacOS->'"$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\%(Filename).a"', ' ') "$(MSBuildThisFileDirectory)..\..\deps\NativePath\dotnet\osx-x64\libNativePath.a"" />
|
||||
|
||||
</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 -->
|
||||
<!-- ================================================================ -->
|
||||
|
||||
Reference in New Issue
Block a user