summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/platform.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/platform.nim b/compiler/platform.nim
index 7eb897816..ef1d00e08 100644
--- a/compiler/platform.nim
+++ b/compiler/platform.nim
@@ -230,9 +230,6 @@ proc setTarget*(t: var Target; o: TSystemOS, c: TSystemCPU) =
   #echo "new Target: OS: ", o, " CPU: ", c
   t.targetCPU = c
   t.targetOS = o
-  # assume no cross-compiling
-  t.hostCPU = c
-  t.hostOS = o
   t.intSize = CPU[c].intSize div 8
   t.floatSize = CPU[c].floatSize div 8
   t.ptrSize = CPU[c].bit div 8
@@ -251,4 +248,6 @@ proc nameToCPU*(name: string): TSystemCPU =
   result = cpuNone
 
 proc setTargetFromSystem*(t: var Target) =
-  t.setTarget(nameToOS(system.hostOS), nameToCPU(system.hostCPU))
+  t.hostOS = nameToOS(system.hostOS)
+  t.hostCPU = nameToCPU(system.hostCPU)
+  t.setTarget(t.hostOS, t.hostCPU)