Sync upstream

This commit is contained in:
Mark Qvist 2025-11-24 18:08:02 +01:00
commit 0ae8092914
7 changed files with 12 additions and 8 deletions

View file

@ -16,11 +16,16 @@ else:
ffi = FFI()
try:
filterlib_spec = find_spec("LXST.filterlib")
if not filterlib_spec or filterlib_spec.origin == None: raise ImportError("Could not locate pre-compiled LXST.filterlib module")
with open(os.path.join(c_src_path, "Filters.h"), "r") as f: ffi.cdef(f.read())
native_functions = ffi.dlopen(filterlib_spec.origin)
USE_NATIVE_FILTERS = True
# Disable native filterlib loading on Windows
# for now due to strange linking behaviour,
# but allow local compilation if the user has
# a C compiler installed.
if not RNS.vendor.platformutils.is_windows():
filterlib_spec = find_spec("LXST.filterlib")
if not filterlib_spec or filterlib_spec.origin == None: raise ImportError("Could not locate pre-compiled LXST.filterlib module")
with open(os.path.join(c_src_path, "Filters.h"), "r") as f: ffi.cdef(f.read())
native_functions = ffi.dlopen(filterlib_spec.origin)
USE_NATIVE_FILTERS = True
except Exception as e:
RNS.log(f"Could not load pre-compiled LXST filters library. The contained exception was: {e}", RNS.LOG_WARNING)