summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-09-24 13:24:41 +0200
committerGitHub <noreply@github.com>2021-09-24 13:24:41 +0200
commit5d315ebcc2d4f46b4a74c6ab10146466c894b9de (patch)
tree1ba20d35b0c8cb9402fae7c8b6b1ec2a9676d8cd /compiler
parent561b01004cfeb572f82327cd8a3de55d076cb5ff (diff)
downloadNim-5d315ebcc2d4f46b4a74c6ab10146466c894b9de.tar.gz
ported Nim to proprietary CrossOS [backport] (#18889)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/installer.ini1
-rw-r--r--compiler/options.nim6
-rw-r--r--compiler/platform.nim6
3 files changed, 10 insertions, 3 deletions
diff --git a/compiler/installer.ini b/compiler/installer.ini
index 3f1630a92..9e31b4e3f 100644
--- a/compiler/installer.ini
+++ b/compiler/installer.ini
@@ -13,6 +13,7 @@ Platforms: """
   netbsd: i386;amd64
   openbsd: i386;amd64;arm;arm64
   dragonfly: i386;amd64
+  crossos: amd64
   haiku: i386;amd64
   android: i386;arm;arm64
   nintendoswitch: arm64
diff --git a/compiler/options.nim b/compiler/options.nim
index ea302aed6..eafcd816d 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -577,11 +577,13 @@ proc isDefined*(conf: ConfigRef; symbol: string): bool =
                             osQnx, osAtari, osAix,
                             osHaiku, osVxWorks, osSolaris, osNetbsd,
                             osFreebsd, osOpenbsd, osDragonfly, osMacosx, osIos,
-                            osAndroid, osNintendoSwitch, osFreeRTOS}
+                            osAndroid, osNintendoSwitch, osFreeRTOS, osCrossos}
     of "linux":
       result = conf.target.targetOS in {osLinux, osAndroid}
     of "bsd":
-      result = conf.target.targetOS in {osNetbsd, osFreebsd, osOpenbsd, osDragonfly}
+      result = conf.target.targetOS in {osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osCrossos}
+    of "freebsd":
+      result = conf.target.targetOS in {osFreebsd, osCrossos}
     of "emulatedthreadvars":
       result = platform.OS[conf.target.targetOS].props.contains(ospLacksThreadVars)
     of "msdos": result = conf.target.targetOS == osDos
diff --git a/compiler/platform.nim b/compiler/platform.nim
index 7bc77d809..1bc00b629 100644
--- a/compiler/platform.nim
+++ b/compiler/platform.nim
@@ -20,7 +20,7 @@ type
   TSystemOS* = enum # Also add OS in initialization section and alias
                     # conditionals to condsyms (end of module).
     osNone, osDos, osWindows, osOs2, osLinux, osMorphos, osSkyos, osSolaris,
-    osIrix, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osAix, osPalmos, osQnx,
+    osIrix, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osCrossos, osAix, osPalmos, osQnx,
     osAmiga, osAtari, osNetware, osMacos, osMacosx, osIos, osHaiku, osAndroid, osVxWorks
     osGenode, osJS, osNimVM, osStandalone, osNintendoSwitch, osFreeRTOS, osAny
 
@@ -105,6 +105,10 @@ const
       scriptExt: ".sh", curDir: ".",
       exeExt: "", extSep: ".",
       props: {ospNeedsPIC, ospPosix}),
+     (name: "CROSSOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
+      objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/",
+      scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".",
+      props: {ospNeedsPIC, ospPosix}),
      (name: "AIX", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
       objExt: ".o", newLine: "\x0A", pathSep: ":", dirSep: "/",
       scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".",