dll path
This commit is contained in:
parent
eeae6c3773
commit
fc39e79a5b
2 changed files with 17 additions and 6 deletions
|
@ -1,8 +1,19 @@
|
||||||
import bumpy, chroma, unicode, vmath
|
import bumpy, chroma, os, unicode, vmath
|
||||||
|
|
||||||
export bumpy, chroma, 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
|
type PixieError = object of ValueError
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@ src_path = Path(__file__).resolve()
|
||||||
src_dir = str(src_path.parent)
|
src_dir = str(src_path.parent)
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
dllPath = src_dir + "/pixie.dll"
|
dllPath = "pixie.dll"
|
||||||
elif sys.platform == "darwin":
|
elif sys.platform == "darwin":
|
||||||
dllPath = src_dir + "/libpixie.dylib"
|
dllPath = "libpixie.dylib"
|
||||||
else:
|
else:
|
||||||
dllPath = src_dir + "/libpixie.so"
|
dllPath = "libpixie.so"
|
||||||
dll = cdll.LoadLibrary(dllPath)
|
dll = cdll.LoadLibrary(src_dir + "/" + dllPath)
|
||||||
|
|
||||||
class PixieError(Exception):
|
class PixieError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue