loadNativeLibrary function

DynamicLibrary loadNativeLibrary()

Implementation

ffi.DynamicLibrary loadNativeLibrary() {
  if (Platform.isWindows) {
    return ffi.DynamicLibrary.open("$_libraryName.dll");
  } else if (Platform.isAndroid || Platform.isFuchsia || Platform.isLinux) {
    return ffi.DynamicLibrary.open("lib$_libraryName.so");
  } else if (Platform.isMacOS) {
    return ffi.DynamicLibrary.open("lib$_libraryName.dylib");
  } else if (Platform.isIOS) {
    return ffi.DynamicLibrary.process();
  } else {
    throw UnsupportedError("Platform ${Platform.operatingSystem} not supported");
  }
}