class RbSys::CargoBuilder

def cargo_command(dest_path, args = [])

def cargo_command(dest_path, args = [])
  cmd = []
  cmd += if config.use_cargo_build
    ["cargo", "build"]
  else
    ["cargo", "rustc"]
  end
  cmd += ["--target", target] if target
  cmd += ["--target-dir", dest_path]
  cmd += ["--features", features.join(",")] unless features.empty?
  cmd += ["--lib"]
  cmd += ["--profile", profile.to_s]
  cmd += Gem::Command.build_args
  cmd += args
  if !config.use_cargo_build
    cmd += ["--"]
    cmd += [*rustc_args(dest_path)]
    cmd += extra_rustc_args
  end
  cmd
end