aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/rust.js
diff options
context:
space:
mode:
authorjaredwy <jared.wyles@gmail.com>2017-09-01 19:46:27 +1000
committerjaredwy <jared.wyles@gmail.com>2017-09-01 19:46:27 +1000
commit573ff1027f5109a7996c1db8ba0c04ff0d8f92e0 (patch)
tree729036d42e79d8b24e8cfbf16bf6f47d7f574130 /lib/compilers/rust.js
parent716ce60b16bafdd03b49bffd548179fb9886ec9c (diff)
downloadcompiler-explorer-573ff1027f5109a7996c1db8ba0c04ff0d8f92e0.tar.gz
compiler-explorer-573ff1027f5109a7996c1db8ba0c04ff0d8f92e0.zip
Allow options for filters to look at useroptions this allows us to add/remove options per compiler such as for rust where we need to not add the --emit argument if the user has passed us one
Diffstat (limited to 'lib/compilers/rust.js')
-rw-r--r--lib/compilers/rust.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/compilers/rust.js b/lib/compilers/rust.js
index 3d3bebade..6d2295cbe 100644
--- a/lib/compilers/rust.js
+++ b/lib/compilers/rust.js
@@ -22,16 +22,23 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-var Compile = require('../base-compiler');
+var Compile = require('../base-compiler'),
+ _ = require('underscore-node');
function compileRust(info, env) {
var compiler = new Compile(info, env);
compiler.compiler.supportsIntel = true;
- compiler.optionsForFilter = function (filters, outputFilename) {
+ compiler.optionsForFilter = function (filters, outputFilename, userOptions) {
var options = ['-C', 'debuginfo=1', '-o', this.filename(outputFilename)];
- // TODO: binary not supported(?)
+
+ var userRequestedEmit = _.any(userOptions, function(opt) {
+ return opt.indexOf("--emit") > -1;
+ });
+ //TODO: Binary not supported (?)
if (!filters.binary) {
- options = options.concat('--emit', 'asm');
+ if(!userRequestedEmit) {
+ options = options.concat('--emit', 'asm');
+ }
if (filters.intel) options = options.concat('-Cllvm-args=--x86-asm-syntax=intel');
}
options = options.concat(['--crate-type', 'rlib']);