This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,10 @@
{
"name": "Unity.Toolchain.Linux-x86_64-Linux",
"references": [
"Unity.SysrootPackage.Editor"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fd4c8fba150c6e24aaceaf5406904a5b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,127 @@
using System.Collections.Generic;
namespace UnityEditor.Il2Cpp
{
/// <summary>
/// Toolchain package implementation for building Linux players on a Linux x86_64 host.
/// </summary>
/// <remarks>
/// This package provides the LLVM/Clang toolchain (compiler, linker, etc.). It does not
/// include a sysroot; pair it with a matching sysroot package when cross-compiling.
/// The payload is distributed via UPM under <see cref="_packageName"/> and installed
/// into the sysroot/toolchain cache by the base <c>SysrootPackage</c>.
/// </remarks>
public class ToolchainLinuxX86_64 : SysrootPackage
{
/// <summary>
/// UPM package name that ships the LLVM/Clang toolchain payload.
/// </summary>
private string _packageName => "com.unity.toolchain.linux-x86_64-linux";
/// <summary>
/// Human-readable package name as exposed to callers.
/// </summary>
public override string Name => _packageName;
/// <summary>
/// Host operating system this toolchain runs on.
/// </summary>
public override string HostPlatform => "linux";
/// <summary>
/// Host CPU architecture this toolchain runs on.
/// </summary>
public override string HostArch => "x86_64";
/// <summary>
/// Target operating system this toolchain is intended to produce binaries for.
/// </summary>
/// <remarks>
/// The exact target triple and sysroot (if any) are provided elsewhere (e.g., by a sysroot package
/// and compiler flags). This package focuses on supplying the host-side tool binaries.
/// </remarks>
public override string TargetPlatform => "linux";
/// <summary>
/// Identifier for the specific payload version expected by this package.
/// </summary>
/// <remarks>
/// CI typically substitutes this placeholder at pack/publish time so the package resolves
/// a precise, immutable payload directory on disk.
/// </remarks>
private string _payloadVersion => "15.0.6_99c1b61e5651af630294cdd18fbd4d55900aad70f94c602c76b35989f0b571cf-1";
/// <summary>
/// Relative path (under the cache) to the toolchain payload root for this host/target.
/// </summary>
private string _payloadDir;
/// <summary>
/// Relative path (inside the payload) to the linker binary to use with <c>-fuse-ld=</c>.
/// </summary>
private string _linkerFile => "bin/ld.lld";
/// <summary>
/// Initializes the package and registers its toolchain payload so it can be resolved on disk.
/// </summary>
public ToolchainLinuxX86_64()
: base()
{
_payloadDir = $"llvm-linux-x64/{_payloadVersion}";
RegisterPayload(_packageName, _payloadDir);
}
/// <summary>
/// Gets the absolute path to the installed toolchain payload root directory.
/// </summary>
/// <returns>Absolute path to the toolchain payload root.</returns>
public string PathToPayload()
{
return PayloadInstallDirectory(_payloadDir).ToString();
}
/// <summary>
/// Absolute path to a sysroot for IL2CPP (not applicable for this toolchain-only package).
/// </summary>
/// <returns>Always <c>null</c> for this package.</returns>
public override string GetSysrootPath()
{
return null;
}
/// <summary>
/// Absolute path to the installed toolchain that IL2CPP should use.
/// </summary>
/// <returns>Absolute path to the toolchain payload root.</returns>
public override string GetToolchainPath()
{
return PathToPayload();
}
/// <summary>
/// Additional compiler flags to pass to IL2CPP/Clang (none required by this package).
/// </summary>
/// <remarks>
/// Targeting flags (e.g., <c>-target</c>) are typically supplied by the corresponding sysroot package.
/// </remarks>
/// <returns><c>null</c> (no extra compiler flags).</returns>
public override string GetIl2CppCompilerFlags()
{
return null;
}
/// <summary>
/// Additional linker flags to ensure IL2CPP uses this package's linker.
/// </summary>
/// <remarks>
/// Forces the linker to the payload’s <c>ld.lld</c> via <c>-fuse-ld=</c> (quoted path), and links
/// libstdc++ statically for portability. Adjust if your distribution policy prefers dynamic libstdc++.
/// </remarks>
/// <returns>A space-separated string of linker flags.</returns>
public override string GetIl2CppLinkerFlags()
{
var linkerpath = PayloadInstallDirectory(_payloadDir).Combine(_linkerFile);
return $"-fuse-ld={linkerpath.InQuotes()} -static-libstdc++";
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b7b67bf410e915042b5ea29b50f488a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: