Bug 1412044 - Use separate arguments for rustc's -C option; r=ted

We subtly changed from "-C opt=value" to "-Copt=value" in 472232499478
(bug 1411081). This change appears to confuse sccache (which has its
own option parser).

This commit restores the old behavior of using separate arguments
for -C and its value.

MozReview-Commit-ID: JCnAjt1Tdsa

--HG--
extra : rebase_source : 2ad7aaf819c0c941efa2272c91d74ae7e52629e8
This commit is contained in:
Gregory Szorc 2017-10-26 11:26:14 -07:00
parent 2c6696ea8e
commit 26e6361ee7

View File

@ -1346,15 +1346,19 @@ def rust_compiler_flags(opt_level_option, debug_rust, debug_symbols,
if debug_symbols:
debug_info = '2'
flags = []
opts = []
if opt_level is not None:
flags.append('-Copt-level=%s' % opt_level)
opts.append('opt-level=%s' % opt_level)
if debug_assertions is not None:
flags.append('-Cdebug-assertions=%s' %
opts.append('debug-assertions=%s' %
('yes' if debug_assertions else 'no'))
if debug_info is not None:
flags.append('-Cdebuginfo=%s' % debug_info)
opts.append('debuginfo=%s' % debug_info)
flags = []
for opt in opts:
flags.extend(['-C', opt])
return flags