summaryrefslogtreecommitdiff
path: root/src/tomcrypt/private/config.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/tomcrypt/private/config.nim')
-rw-r--r--src/tomcrypt/private/config.nim30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/tomcrypt/private/config.nim b/src/tomcrypt/private/config.nim
index d2ee793..d821ff9 100644
--- a/src/tomcrypt/private/config.nim
+++ b/src/tomcrypt/private/config.nim
@@ -5,22 +5,32 @@ template currentSourceDir(): string =
parentDir(currentSourcePath())
when not defined(tomcryptPrefix):
- const tomcryptPrefix* = currentSourceDir()
+ const tomcryptPrefix = currentSourceDir()
-when not defined(tomcryptIncDir):
- const tomcryptIncDir* = tomcryptPrefix / "include"
+when not defined(tomcryptIncPath):
+ const tomcryptIncPath = tomcryptPrefix / "include"
when defined(vcc):
- {.passC:"/I" & tomcryptIncDir.}
+ {.passC:"/I" & tomcryptIncPath.}
else:
- {.passC:"-I" & tomcryptIncDir.}
+ {.passC:"-I" & tomcryptIncPath.}
-when not defined(tomcryptLibDir):
- const tomcryptLibDir* = tomcryptPrefix / "lib"
+when not defined(tomcryptLibPath):
+ const tomcryptLibPath = tomcryptPrefix / "lib"
when defined(vcc):
- const tomcryptLibPath* = tomcryptLibDir / "tomcrypt.lib"
+ const libraryPath = tomcryptLibPath / "tomcrypt.lib"
else:
- const tomcryptLibPath* = tomcryptLibDir / "libtomcrypt.a"
+ const libraryPath = tomcryptLibPath / "libtomcrypt.a"
-{.passL:tomcryptLibPath.}
+{.passL:libraryPath.}
+
+# Import tommath config to make Nim link the libtommath library also which is
+# needed. The import should be done after passC/passL above to order the
+# libraries correctly for the C compiler.
+import tommath/private/config
+
+when defined(vcc):
+ {.passC:"/DLTM_DESC".}
+else:
+ {.passC:"-DLTM_DESC".}