Pass optimization flags to rustc properly. Closes: #5788.

pull/5813/head
Jussi Pakkanen 6 years ago
parent f431cff809
commit 80ef6fd69f
  1. 1
      mesonbuild/backend/ninjabackend.py
  2. 10
      mesonbuild/compilers/rust.py

@ -1287,6 +1287,7 @@ int dummy;
args += ['--crate-name', target.name]
args += rustc.get_buildtype_args(self.get_option_for_target('buildtype', target))
args += rustc.get_debug_args(self.get_option_for_target('debug', target))
args += rustc.get_optimization_args(self.get_option_for_target('optimization', target))
args += self.build.get_global_args(rustc, target.for_machine)
args += self.build.get_project_args(rustc, target.subproject, target.for_machine)
depfile = os.path.join(target.subdir, target.name + '.d')

@ -19,11 +19,11 @@ from ..mesonlib import EnvironmentException, MachineChoice, Popen_safe
from .compilers import Compiler, rust_buildtype_args, clike_debug_args
rust_optimization_args = {'0': [],
'g': ['-C', '--opt-level=0'],
'1': ['-C', '--opt-level=1'],
'2': ['-C', '--opt-level=2'],
'3': ['-C', '--opt-level=3'],
's': ['-C', '--opt-level=s'],
'g': ['-C', 'opt-level=0'],
'1': ['-C', 'opt-level=1'],
'2': ['-C', 'opt-level=2'],
'3': ['-C', 'opt-level=3'],
's': ['-C', 'opt-level=s'],
}
class RustCompiler(Compiler):

Loading…
Cancel
Save