machine_spec: Adapt to host when equal and triplet set

So the triplet is used for the build machine when not cross-compiling.
This is important so we use the correct toolchain in such cases.
This commit is contained in:
Ole André Vadla Ravnås committed 2024-05-14 11:27:49 +00:00
1 parent d48dfa2ebe
commit 10eebbf030
1 file changed
+2
+2
View File
@@ -85,6 +85,8 @@ class MachineSpec:
return self.evolve(config=config)
def maybe_adapt_to_host(self, host_machine: MachineSpec) -> MachineSpec:
if self.identifier == host_machine.identifier and host_machine.triplet is not None:
return host_machine
if self.os == "windows":
if self.arch == "x86_64" and host_machine.arch == "x86":
return host_machine