labstreaminglayer / pylsl

Python bindings (pylsl) for liblsl
MIT License
142 stars 58 forks source link

Forward-compatibility with lsl.dll naming scheme when dll not on system path #24

Closed cboulay closed 4 years ago

cboulay commented 4 years ago

While util.find_library('lsl') would find lsl.dll if it were on a search path, it doesn't find it if it's only in the pylsl/lib folder. Solution: change

libbasepath = os.path.join(os.path.dirname(__file__), 'lib', 'liblsl')
for debugsuffix in ['', '-debug']:
    for bitness in ['', str(8 * struct.calcsize("P"))]:
        path = libbasepath + bitness + debugsuffix + libsuffix

to

libbasepath = os.path.join(os.path.dirname(__file__), 'lib')
for libprefix in ['', 'lib']:
    for debugsuffix in ['', '-debug']:
        for bitness in ['', str(8 * struct.calcsize("P"))]:
            path = os.path.join(libbasepath, libprefix + 'lsl' + bitness + debugsuffix + libsuffix)

I will deal with this later.