summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tommath/private/config.nim13
-rw-r--r--src/tommath/tommath.nim2
2 files changed, 15 insertions, 0 deletions
diff --git a/src/tommath/private/config.nim b/src/tommath/private/config.nim
new file mode 100644
index 0000000..07893da
--- /dev/null
+++ b/src/tommath/private/config.nim
@@ -0,0 +1,13 @@
+import os
+
+template currentSourceDir(): string =
+ ## Return the directory the current source file resides in.
+ parentDir(currentSourcePath())
+
+when hostOS == "windows":
+ const libraryName = currentSourceDir() & "/lib/tommath.lib"
+else:
+ const libraryName = currentSourceDir() & "/lib/libtommath.a"
+
+{.passC:"-I" & currentSourceDir() & "/include".}
+{.passL:libraryName.}
diff --git a/src/tommath/tommath.nim b/src/tommath/tommath.nim
index 9287778..f45763c 100644
--- a/src/tommath/tommath.nim
+++ b/src/tommath/tommath.nim
@@ -1,3 +1,5 @@
+include private/config
+
type
mp_digit* = distinct uint32
mp_word* = distinct uint64