Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build_projects/dotnet-host-build/CompileTargets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public static BuildTargetResult CompileCoreHost(BuildTargetContext c)
var configuration = c.BuildContext.Get<string>("Configuration");
string rid = c.BuildContext.Get<string>("TargetRID");
string platform = c.BuildContext.Get<string>("Platform");
string crossEnv = c.BuildContext.Get<string>("Cross");

// Generate build files
var cmakeOut = Path.Combine(Dirs.CorehostLatest, "cmake");
Expand Down Expand Up @@ -306,6 +307,11 @@ public static BuildTargetResult CompileCoreHost(BuildTargetContext c)
buildScriptArgList.Add("--commithash");
buildScriptArgList.Add(commitHash);

if (string.Equals(crossEnv, "1"))
{
buildScriptArgList.Add("--cross");
}

ExecIn(cmakeOut, buildScriptFile, buildScriptArgList);

// Copy the output out
Expand Down
13 changes: 13 additions & 0 deletions build_projects/dotnet-host-build/PrepareTargets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,29 @@ public static BuildTargetResult Init(BuildTargetContext c)
configEnv = "Debug";
}

string crossEnv = Environment.GetEnvironmentVariable("CROSS") ?? "0";
if (string.Equals(crossEnv, "1"))
{
string rootfsDir = Environment.GetEnvironmentVariable("ROOTFS_DIR");
if (string.IsNullOrEmpty(rootfsDir))
{
rootfsDir = Path.Combine(Dirs.RepoRoot, "cross", "rootfs", platformEnv);
Environment.SetEnvironmentVariable("ROOTFS_DIR", rootfsDir);
}
}

c.BuildContext["Configuration"] = configEnv;
c.BuildContext["Channel"] = Environment.GetEnvironmentVariable("CHANNEL");
c.BuildContext["Platform"] = platformEnv;
c.BuildContext["TargetRID"] = targetRID;
c.BuildContext["TargetFramework"] = targetFramework;
c.BuildContext["Cross"] = crossEnv;

c.Info($"Building {c.BuildContext["Configuration"]} to: {Dirs.Output}");
c.Info("Build Environment:");
c.Info($" Operating System: {RuntimeEnvironment.OperatingSystem} {RuntimeEnvironment.OperatingSystemVersion}");
c.Info($" Platform: " + platformEnv);
c.Info($" Cross Build: " + int.Parse(crossEnv));

return c.Success();
}
Expand Down