targetsWindows property

bool get targetsWindows

Returns true if building for Windows: the --target-os argument, or the current platform.

Implementation

bool get targetsWindows {
  for (var i = 0; i < args.length; ++i) {
    var a = args[i];
    if (a.startsWith('--target-os=')) {
      return a.substring('--target-os='.length) == 'windows';
    } else if (a == '--target-os' && i + 1 < args.length) {
      return args[i + 1] == 'windows';
    }
  }
  return Platform.isWindows;
}