Skip to content

Commit f43aa16

Browse files
committed
🐛 fix Linux 不编译 ASF
1 parent c0e757d commit f43aa16

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/BD.WTTS.Client.Tools.Publish/Commands/IDotNetPublishCommand.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using static BD.WTTS.Client.Tools.Publish.Helpers.DotNetCLIHelper;
66
using static BD.WTTS.GlobalDllImportResolver;
77
using JsonSerializer = System.Text.Json.JsonSerializer;
8+
using System.Runtime.InteropServices;
89

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

@@ -843,6 +844,7 @@ static PublishCommandArg SetPublishCommandArgumentList(
843844
arg.ReadyToRun = false;
844845
arg.Trimmed = false;
845846
arg.SelfContained = false;
847+
arg.Architecture = architecture;
846848
// https://learn.microsoft.com/zh-cn/dotnet/core/tools/dotnet-run
847849
// https://download.visualstudio.microsoft.com/download/pr/c1e2729e-ab96-4929-911d-bf0f24f06f47/1b2f39cbc4eb530e39cfe6f54ce78e45/aspnetcore-runtime-7.0.7-linux-x64.tar.gz
848850
// dotnet "Steam++.dll" -clt devtools
@@ -889,7 +891,9 @@ record struct PublishCommandArg(
889891
bool? EnableMsixTooling = null,
890892
bool? GenerateAppxPackageOnBuild = null,
891893
bool? StripSymbols = null,
892-
bool? CreatePackage = null)
894+
bool? CreatePackage = null,
895+
Architecture? Architecture = null
896+
)
893897
{
894898
string? _Configuration;
895899

@@ -1150,11 +1154,13 @@ static IEnumerable<string> GetPluginNames(Platform platform)
11501154
yield return AssemblyInfo.Accelerator;
11511155
yield return AssemblyInfo.GameAccount;
11521156
yield return AssemblyInfo.GameList;
1153-
yield return AssemblyInfo.ArchiSteamFarmPlus;
11541157
yield return AssemblyInfo.Authenticator;
1158+
yield return AssemblyInfo.SteamIdleCard;
11551159
if (platform == Platform.Windows)
1160+
{
1161+
yield return AssemblyInfo.ArchiSteamFarmPlus;
11561162
yield return AssemblyInfo.GameTools;
1157-
yield return AssemblyInfo.SteamIdleCard;
1163+
}
11581164
}
11591165

11601166
/// <summary>

src/BD.WTTS.Client.Tools.Publish/Constants.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface Constants
2525
static readonly string[] all_rids = new[] {
2626
"win-x64", "win-x86", "win-arm64",
2727
"osx-x64", "osx-arm64",
28-
"linux-x64", "linux-arm64",
28+
"linux-x64", "linux-arm64", "linux-loongarch64",
2929
};
3030

3131
static readonly string[] ignoreDirNames = new[]
@@ -122,6 +122,7 @@ static string GetVersion()
122122
Architecture.Arm64 => "arm64",
123123
Architecture.X64 => "x64",
124124
Architecture.X86 => "x86",
125+
Architecture.LoongArch64 => "loongarch64",
125126
_ => throw new ArgumentOutOfRangeException(nameof(architecture), architecture, null),
126127
};
127128

@@ -160,6 +161,12 @@ static string GetVersion()
160161
case "arm64":
161162
info.Architecture = Architecture.Arm64;
162163
break;
164+
case "loongarch64":
165+
info.Architecture = Architecture.LoongArch64;
166+
break;
167+
case "riscv64":
168+
info.Architecture = Architecture.RiscV64;
169+
break;
163170
}
164171
}
165172
return info;

src/BD.WTTS.Client/Helpers/GlobalDllImportResolver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ static string GetRID()
4343
Architecture.Arm64 => "linux-arm64", // 在 64 位 ARM 上运行的 Linux 发行版本,如 Raspberry Pi Model 3 及更高版本上的 Ubuntu 服务器 64 位
4444
Architecture.Arm => "linux-arm", // 在 ARM 上运行的 Linux 发行版本,如 Raspberry Pi Model 2 及更高版本上的 Raspbian
4545
Architecture.Armv6 => "linux-armv6",
46+
Architecture.LoongArch64 => "linux-loongarch64", // 在龙芯 LoongArch64 上运行的 Linux 发行版本
47+
Architecture.RiscV64 => "linux-riscv64", // 在 RISC-V 64 位上运行的 Linux 发行版本
4648
_ => throw new PlatformNotSupportedException(),
4749
};
4850
#else

0 commit comments

Comments
 (0)