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.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tomcrypt/private/config.nim b/src/tomcrypt/private/config.nim
new file mode 100644
index 0000000..99c73c7
--- /dev/null
+++ b/src/tomcrypt/private/config.nim
@@ -0,0 +1,26 @@
+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.}