Skip to content

Commit

Permalink
Merge pull request #2 from SMGCommunity/NativeLinuxSupport
Browse files Browse the repository at this point in the history
Add native Linux support
  • Loading branch information
bavario-lginc authored Sep 3, 2024
2 parents d46031c + 1581d4a commit c0c140d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
19 changes: 10 additions & 9 deletions SyatiModuleBuildTool/CompileUtility.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace SyatiModuleBuildTool;

Expand Down Expand Up @@ -39,17 +40,17 @@ public static class CompileUtility

public static void Compile(string Flags, string Includes, List<(string source, string build)> CompilerTasks, List<(string source, string build)> AssemblerTasks, string SyatiFolderPath)
{
string Compiler = $"{Path.Combine(SyatiFolderPath, "deps/CodeWarrior/mwcceppc.exe")}";
string Assembler = $"{Path.Combine(SyatiFolderPath, "deps/CodeWarrior/mwasmeppc.exe")}";


#if _WINDOWS
string Compiler, Assembler;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
Compiler = $"{Path.Combine(SyatiFolderPath, "deps/CodeWarrior/mwcceppc.exe")}";
Assembler = $"{Path.Combine(SyatiFolderPath, "deps/CodeWarrior/mwasmeppc.exe")}";
} else {
Compiler = $"{Path.Combine(SyatiFolderPath, "deps/CodeWarrior/mwcceppc")}";
Assembler = $"{Path.Combine(SyatiFolderPath, "deps/CodeWarrior/mwasmeppc")}";
}
string CompileCommand = $"{string.Join(" ", CompilerFlags)} {Includes}";
string AssembleCommand = $"{string.Join(" ", CompilerFlags)} {Includes}";
#else
string CompileCommand = $"wine {string.Join(" ", CompilerFlags)} {Includes}";
string AssembleCommand = $"wine {string.Join(" ", CompilerFlags)} {Includes}";
#endif


for (int i = 0; i < CompilerTasks.Count; i++)
{
Expand Down
8 changes: 7 additions & 1 deletion SyatiModuleBuildTool/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace SyatiModuleBuildTool;

Expand Down Expand Up @@ -133,7 +134,12 @@ void TryLoadModule(string ModulePath)

Console.WriteLine();
Console.WriteLine("Linking...");
string Kamek = $"{Path.Combine(SyatiFolderPath, "deps/Kamek/Kamek.exe")}";
string Kamek;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
Kamek = $"{Path.Combine(SyatiFolderPath, "deps/Kamek/Kamek.exe")}";
} else {
Kamek = $"{Path.Combine(SyatiFolderPath, "deps/Kamek/Kamek")}";
}
List<string> SymbolPaths =
[
Path.Combine(SyatiFolderPath, "symbols"),
Expand Down

0 comments on commit c0c140d

Please sign in to comment.