From 7eec4bad08139426de4bfd5bcb54907fd01dd8e5 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Tue, 13 Mar 2018 17:32:37 +0200 Subject: Update config.nim --- src/tomcrypt/private/config.nim | 30 ++++++++++++++++++++---------- src/tomcrypt/tomcrypt.nim | 4 +--- 2 files changed, 21 insertions(+), 13 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".} diff --git a/src/tomcrypt/tomcrypt.nim b/src/tomcrypt/tomcrypt.nim index 9bb42ad..f7d953e 100644 --- a/src/tomcrypt/tomcrypt.nim +++ b/src/tomcrypt/tomcrypt.nim @@ -1,3 +1 @@ -# tomcrypt_nim -# Copyright Oskari Timperi -# libtomcrypt for Nim +import private/config -- cgit v1.2.3