Skip to content

Commit

Permalink
🐛 fix Linux 不编译 ASF
Browse files Browse the repository at this point in the history
  • Loading branch information
Mossimos committed Jan 23, 2025
1 parent c0e757d commit f43aa16
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using static BD.WTTS.Client.Tools.Publish.Helpers.DotNetCLIHelper;
using static BD.WTTS.GlobalDllImportResolver;
using JsonSerializer = System.Text.Json.JsonSerializer;
using System.Runtime.InteropServices;

namespace BD.WTTS.Client.Tools.Publish.Commands;

Expand Down Expand Up @@ -843,6 +844,7 @@ static PublishCommandArg SetPublishCommandArgumentList(
arg.ReadyToRun = false;
arg.Trimmed = false;
arg.SelfContained = false;
arg.Architecture = architecture;
// https://learn.microsoft.com/zh-cn/dotnet/core/tools/dotnet-run
// https://download.visualstudio.microsoft.com/download/pr/c1e2729e-ab96-4929-911d-bf0f24f06f47/1b2f39cbc4eb530e39cfe6f54ce78e45/aspnetcore-runtime-7.0.7-linux-x64.tar.gz
// dotnet "Steam++.dll" -clt devtools
Expand Down Expand Up @@ -889,7 +891,9 @@ record struct PublishCommandArg(
bool? EnableMsixTooling = null,
bool? GenerateAppxPackageOnBuild = null,
bool? StripSymbols = null,
bool? CreatePackage = null)
bool? CreatePackage = null,
Architecture? Architecture = null
)
{
string? _Configuration;

Expand Down Expand Up @@ -1150,11 +1154,13 @@ static IEnumerable<string> GetPluginNames(Platform platform)
yield return AssemblyInfo.Accelerator;
yield return AssemblyInfo.GameAccount;
yield return AssemblyInfo.GameList;
yield return AssemblyInfo.ArchiSteamFarmPlus;
yield return AssemblyInfo.Authenticator;
yield return AssemblyInfo.SteamIdleCard;
if (platform == Platform.Windows)
{
yield return AssemblyInfo.ArchiSteamFarmPlus;
yield return AssemblyInfo.GameTools;
yield return AssemblyInfo.SteamIdleCard;
}
}

/// <summary>
Expand Down
9 changes: 8 additions & 1 deletion src/BD.WTTS.Client.Tools.Publish/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface Constants
static readonly string[] all_rids = new[] {
"win-x64", "win-x86", "win-arm64",
"osx-x64", "osx-arm64",
"linux-x64", "linux-arm64",
"linux-x64", "linux-arm64", "linux-loongarch64",
};

static readonly string[] ignoreDirNames = new[]
Expand Down Expand Up @@ -122,6 +122,7 @@ static string GetVersion()
Architecture.Arm64 => "arm64",
Architecture.X64 => "x64",
Architecture.X86 => "x86",
Architecture.LoongArch64 => "loongarch64",
_ => throw new ArgumentOutOfRangeException(nameof(architecture), architecture, null),
};

Expand Down Expand Up @@ -160,6 +161,12 @@ static string GetVersion()
case "arm64":
info.Architecture = Architecture.Arm64;
break;
case "loongarch64":
info.Architecture = Architecture.LoongArch64;
break;
case "riscv64":
info.Architecture = Architecture.RiscV64;
break;
}
}
return info;
Expand Down
2 changes: 2 additions & 0 deletions src/BD.WTTS.Client/Helpers/GlobalDllImportResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ static string GetRID()
Architecture.Arm64 => "linux-arm64", // 在 64 位 ARM 上运行的 Linux 发行版本,如 Raspberry Pi Model 3 及更高版本上的 Ubuntu 服务器 64 位
Architecture.Arm => "linux-arm", // 在 ARM 上运行的 Linux 发行版本,如 Raspberry Pi Model 2 及更高版本上的 Raspbian
Architecture.Armv6 => "linux-armv6",
Architecture.LoongArch64 => "linux-loongarch64", // 在龙芯 LoongArch64 上运行的 Linux 发行版本
Architecture.RiscV64 => "linux-riscv64", // 在 RISC-V 64 位上运行的 Linux 发行版本
_ => throw new PlatformNotSupportedException(),
};
#else
Expand Down

0 comments on commit f43aa16

Please sign in to comment.