canCompile method

bool canCompile(
  1. TargetOs targetOs
)

Whether the current host can compile for targetOs via dart compile exe --target-os. Linux is compilable from any host; macOS and Windows targets require running natively on that OS.

Implementation

bool canCompile(TargetOs targetOs) {
  return switch ((targetOs, this)) {
    (TargetOs.linux, _) => true,
    (TargetOs.macos, TargetOs.macos) => true,
    (TargetOs.windows, TargetOs.windows) => true,
    _ => false,
  };
}