From fc39e79a5bfbbf0e4a1d3b62d3507ee50f808dc3 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Thu, 26 Aug 2021 12:26:34 -0500 Subject: [PATCH] dll path --- bindings/generated/pixie.nim | 15 +++++++++++++-- bindings/generated/pixie.py | 8 ++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/bindings/generated/pixie.nim b/bindings/generated/pixie.nim index af2b8aa..141544c 100644 --- a/bindings/generated/pixie.nim +++ b/bindings/generated/pixie.nim @@ -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 diff --git a/bindings/generated/pixie.py b/bindings/generated/pixie.py index c24fc70..c0d7584 100644 --- a/bindings/generated/pixie.py +++ b/bindings/generated/pixie.py @@ -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