diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2018-03-13 17:32:37 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2018-03-13 17:32:37 +0200 |
| commit | 7eec4bad08139426de4bfd5bcb54907fd01dd8e5 (patch) | |
| tree | f92c6a97c3563393cd2b500a11bf318c492d7363 | |
| parent | 8ecb9ab083d79acc23b0d5a60f91d75c21965acb (diff) | |
| download | tomcrypt-nim-7eec4bad08139426de4bfd5bcb54907fd01dd8e5.tar.gz tomcrypt-nim-7eec4bad08139426de4bfd5bcb54907fd01dd8e5.zip | |
Update config.nim
| -rw-r--r-- | src/tomcrypt/private/config.nim | 30 | ||||
| -rw-r--r-- | 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 |
