callOSDependencyCheck function

ProcessResult callOSDependencyCheck(
  1. String libraryPath
)

Call OS-specific CLI tools for resolving Dynamic Library Dependencies

  • Windows: dumpbin /DEPENDENTS [LIBRARY_PATH]
  • MacOS: otool -L [LIBRARY_PATH]
  • Linux: ldd [LIBRARY_PATH]

Implementation

ProcessResult callOSDependencyCheck(String libraryPath) {
  return Platform.isWindows
      ? Process.runSync('dumpbin', ['/DEPENDENTS', libraryPath])
      : Platform.isMacOS || Platform.isIOS
          ? Process.runSync('otool', ['-L', libraryPath])
          : Process.runSync('ldd', [libraryPath]);
}