summaryrefslogtreecommitdiff
path: root/src/tomcrypt/private/config.nim
blob: d821ff96c438f70daa6081fd133ee53382adcc9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os

template currentSourceDir(): string =
    ## Return the directory the current source file resides in.
    parentDir(currentSourcePath())

when not defined(tomcryptPrefix):
    const tomcryptPrefix = currentSourceDir()

when not defined(tomcryptIncPath):
    const tomcryptIncPath = tomcryptPrefix / "include"

when defined(vcc):
    {.passC:"/I" & tomcryptIncPath.}
else:
    {.passC:"-I" & tomcryptIncPath.}

when not defined(tomcryptLibPath):
    const tomcryptLibPath = tomcryptPrefix / "lib"

when defined(vcc):
    const libraryPath = tomcryptLibPath / "tomcrypt.lib"
else:
    const libraryPath = tomcryptLibPath / "libtomcrypt.a"

{.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".}