dylib 0.3.2+1
dylib: ^0.3.2+1 copied to clipboard

A set of helpers for resolving names and paths of dynamic libraries.

dylib #

pub license: MIT build codecov

A set of helpers for resolving names and paths of dynamic libraries.

PlatformName
Androidlibfoo.so
iOSlibfoo.dylib
Linuxlibfoo.so
macOSlibfoo.dylib
Windowsfoo.dll

Usage #

A simple usage example:

import 'package:dylib/dylib.dart';

import 'foo_bindings.dart'; // LibFoo generated by ffigen, for example

LibFoo get libfoo {
  return _libfoo ??= LibFoo(ffi.DynamicLibrary.open(
    resolveDylibPath(
      'foo', // foo.dll vs. libfoo.so vs. libfoo.dylib
      dartDefine: 'LIBFOO_PATH',
      environmentVariable: 'LIBFOO_PATH',
    ),
  ));
}

void main() {
  libfoo.bar();
}
3
likes
120
pub points
82%
popularity

A set of helpers for resolving names and paths of dynamic libraries.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

meta, path, platform

More

Packages that depend on dylib