From ac4b41450b7e8f59496a374d0f396a3d443f21b2 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Mon, 12 Mar 2018 19:55:03 +0200 Subject: Make the library include & link stuff --- src/tommath/private/config.nim | 13 +++++++++++++ src/tommath/tommath.nim | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 src/tommath/private/config.nim 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 -- cgit v1.2.3