HarryR / ethsnarks

A toolkit for viable zk-SNARKS on Ethereum, Web, Mobile and Desktop
GNU Lesser General Public License v3.0
240 stars 57 forks source link

Use correct native library extension on various platforms #23

Closed HarryR closed 6 years ago

HarryR commented 6 years ago

At the moment the tests hard-code .so, but on OSX .dylib is the library extension and on Windows .dll is

import platform
from ctypes import *

# get the right filename
if platform.uname()[0] == "Windows":
    name = "win.dll"
if platform.uname()[0] == "Linux":
    name = "linux.so"
else:
    name = "osx.dylib"

# load the library
lib = cdll.LoadLibrary(name)

Can probably add a utility function which appends the correct library extension, and use that in tests?