Browse Source

Only pass -Oz to clang

Closes #241
cl-test
Alex Crichton 8 years ago
parent
commit
b8efa21179
  1. 4
      src/lib.rs

4
src/lib.rs

@ -158,7 +158,7 @@ pub struct Tool {
/// Each family of tools differs in how and what arguments they accept. /// Each family of tools differs in how and what arguments they accept.
/// ///
/// Detection of a family is done on best-effort basis and may not accurately reflect the tool. /// Detection of a family is done on best-effort basis and may not accurately reflect the tool.
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug, PartialEq)]
enum ToolFamily { enum ToolFamily {
/// Tool is GNU Compiler Collection-like. /// Tool is GNU Compiler Collection-like.
Gnu, Gnu,
@ -961,7 +961,7 @@ impl Build {
ToolFamily::Clang => { ToolFamily::Clang => {
// arm-linux-androideabi-gcc 4.8 shipped with Android NDK does // arm-linux-androideabi-gcc 4.8 shipped with Android NDK does
// not support '-Oz' // not support '-Oz'
if target.contains("android") && opt_level == "z" { if opt_level == "z" && cmd.family != ToolFamily::Clang {
cmd.args.push("-Os".into()); cmd.args.push("-Os".into());
} else { } else {
cmd.args.push(format!("-O{}", opt_level).into()); cmd.args.push(format!("-O{}", opt_level).into());

Loading…
Cancel
Save