This commit is contained in:
Ryan Oldenburg 2021-08-26 12:26:34 -05:00
parent eeae6c3773
commit fc39e79a5b
2 changed files with 17 additions and 6 deletions

View file

@ -1,8 +1,19 @@
import bumpy, chroma, unicode, vmath
import bumpy, chroma, os, unicode, vmath
export bumpy, chroma, unicode, vmath
{.push dynlib: "pixie.dll".}
let
srcPath = currentSourcePath()
srcDir = srcPath.parentDir()
when defined(windows):
const dllPath = "pixie.dll"
elif defined(macosx):
const dllPath = "libpixie.dll"
else:
const dllPath = "libpixie.so"
{.push dynlib: srcDir / dllPath.}
type PixieError = object of ValueError

View file

@ -6,12 +6,12 @@ src_path = Path(__file__).resolve()
src_dir = str(src_path.parent)
if sys.platform == "win32":
dllPath = src_dir + "/pixie.dll"
dllPath = "pixie.dll"
elif sys.platform == "darwin":
dllPath = src_dir + "/libpixie.dylib"
dllPath = "libpixie.dylib"
else:
dllPath = src_dir + "/libpixie.so"
dll = cdll.LoadLibrary(dllPath)
dllPath = "libpixie.so"
dll = cdll.LoadLibrary(src_dir + "/" + dllPath)
class PixieError(Exception):
pass