Method: RbSys::CargoBuilder#cargo_command

Defined in:
lib/rb_sys/cargo_builder.rb

#cargo_command(dest_path, args = []) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/rb_sys/cargo_builder.rb', line 67

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