|
|
|
@ -128,29 +128,10 @@ Compile.prototype.optionsForFilter = function (filters, outputFilename) {
|
|
|
|
|
if (this.compiler.intelAsm && filters.intel && !filters.binary) {
|
|
|
|
|
options = options.concat(this.compiler.intelAsm.split(" "));
|
|
|
|
|
}
|
|
|
|
|
if (!filters.binary) {
|
|
|
|
|
options = options.concat('-S');
|
|
|
|
|
}
|
|
|
|
|
// TODO: compileToAsm and compileToBinary compilerProps need folding into
|
|
|
|
|
// compiler types. info.asmFlag and info.outputFlag also
|
|
|
|
|
/*
|
|
|
|
|
var asmFlag = this.compiler.asmFlag ? this.compiler.asmFlag : "-S";
|
|
|
|
|
var outputFlag = this.compiler.outputFlag ? this.compiler.outputFlag : "-o";
|
|
|
|
|
var compileToAsm;
|
|
|
|
|
if (!filters.binary) {
|
|
|
|
|
compileToAsm = compilerProps("compileToAsm", asmFlag).split(" ");
|
|
|
|
|
} else {
|
|
|
|
|
compileToAsm = compilerProps("compileToBinary", "").split(" ");
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
if (!filters.binary) options = options.concat('-S');
|
|
|
|
|
return options;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// TODO: where to draw the line between configuration and program behaviour?
|
|
|
|
|
// Per-compiler type stuff? probably things like asmFlag/outputFlag etc should be
|
|
|
|
|
// part of the compiler configuration in the compiler itself. intelAsm?
|
|
|
|
|
// options -- not options; this is reasonably per-compiler instance (e.g. cl include paths)
|
|
|
|
|
// clang gcc toolchain options? per compiler instance again?
|
|
|
|
|
Compile.prototype.prepareArguments = function (userOptions, filters, inputFilename, outputFilename) {
|
|
|
|
|
var options = this.optionsForFilter(filters, outputFilename);
|
|
|
|
|
if (this.compiler.options) {
|
|
|
|
@ -459,13 +440,26 @@ function compile6g(info, env) {
|
|
|
|
|
return compiler;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function compileRust(info, env) {
|
|
|
|
|
var compiler = new Compile(info, env);
|
|
|
|
|
// TODO this needs testing!
|
|
|
|
|
compiler.optionsForFilter = function (filters, outputFilename) {
|
|
|
|
|
var options = ['-g', '-o', this.filename(outputFilename)];
|
|
|
|
|
// TODO: binary not supported(?)
|
|
|
|
|
if (filters.binary) options = options.concat('--emit', 'asm');
|
|
|
|
|
options = options.concat(['--crate-type', 'staticlib']);
|
|
|
|
|
return options;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var compileFactories = {
|
|
|
|
|
"": function (info, env) {
|
|
|
|
|
var comp = new Compile(info, env);
|
|
|
|
|
return comp.initialise();
|
|
|
|
|
},
|
|
|
|
|
"CL": compileCl,
|
|
|
|
|
"6g": compile6g
|
|
|
|
|
"6g": compile6g,
|
|
|
|
|
"rust": compileRust
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function CompileHandler() {
|
|
|
|
|