mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 10:56:09 -06:00
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:
+11
-14
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user