Fix newer Zig versions

- #1304 should be fixed by this commit,
but no way to test it outside beta (Can't test zig locally)
This commit is contained in:
RabsRincon
2019-03-17 12:38:46 +01:00
parent 5c2072bcac
commit d414896bb4
+11 -14
View File
@@ -24,7 +24,8 @@
const BaseCompiler = require('../base-compiler'),
_ = require('underscore'),
path = require('path');
path = require('path'),
Semver = require('semver');
class ZigCompiler extends BaseCompiler {
constructor(info, env) {
@@ -53,21 +54,17 @@ class ZigCompiler extends BaseCompiler {
}
optionsForFilter(filters, outputFilename, userOptions) {
let options;
if (filters.execute) {
options = [
'build-exe',
'--cache-dir', path.dirname(outputFilename),
'--output', this.filename(outputFilename),
'--output-h', '/dev/null'
];
let options = [filters.execute ? 'build-exe' : 'build-obj'];
if (Semver.gt(this.compiler.version, '0.3.0')) {
const outputDir = path.dirname(outputFilename);
options.push('--cache-dir', outputDir,
'--output-dir', outputDir,
'--name', this.filename(outputFilename));
} else {
options = [
'build-obj',
'--cache-dir', path.dirname(outputFilename),
// Older versions use a different command line interface (#1304)
options.push('--cache-dir', path.dirname(outputFilename),
'--output', this.filename(outputFilename),
'--output-h', '/dev/null'
];
'--output-h', '/dev/null');
}
if (!filters.binary) {