aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/zigcc.js
diff options
context:
space:
mode:
authorRubén Rincón Blanco <ruben@rinconblanco.es>2022-04-26 15:24:40 +0200
committerGitHub <noreply@github.com>2022-04-26 15:24:40 +0200
commit4965bd6c8101001dd124df38b3da43cdc2c360a4 (patch)
tree4d7e8133219f88e3e6361cceea9bebb84b62ab02 /lib/compilers/zigcc.js
parente3b9039095333ae3cdec1b9f47419ebac33b6fec (diff)
downloadcompiler-explorer-4965bd6c8101001dd124df38b3da43cdc2c360a4.tar.gz
compiler-explorer-4965bd6c8101001dd124df38b3da43cdc2c360a4.zip
All semver comparisons now ensure it's safe to do so (#3562)
* All semver comparisons now ensure it's safe to do so * Oops, use correct class * Remove leftover import * Leave the Zig fixes for another PR * Fix linter * Fix test issues * Make linter happy, yet again * What? * Address PR review
Diffstat (limited to 'lib/compilers/zigcc.js')
-rw-r--r--lib/compilers/zigcc.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/compilers/zigcc.js b/lib/compilers/zigcc.js
index 689af9e7b..6dccaea1d 100644
--- a/lib/compilers/zigcc.js
+++ b/lib/compilers/zigcc.js
@@ -22,13 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import { ClangCompiler } from './clang';
+import Semver from 'semver';
+
+import {asSafeVer} from '../utils';
+
+import {ClangCompiler} from './clang';
export class ZigCC extends ClangCompiler {
- static get key() { return 'zigcc'; }
+ static get key() {
+ return 'zigcc';
+ }
preProcess(source, filters) {
- if (this.compiler.semver !== '0.6.0') {
+ if (Semver.eq(asSafeVer(this.compiler.semver), '0.6.0', true)) {
filters.binary = true;
}
@@ -36,7 +42,7 @@ export class ZigCC extends ClangCompiler {
}
optionsForFilter(filters, outputFilename) {
- if (this.compiler.semver !== '0.6.0') {
+ if (Semver.eq(asSafeVer(this.compiler.semver), '0.6.0', true)) {
// note: zig versions > 0.6 don't emit asm, only binary works - https://github.com/ziglang/zig/issues/8153
filters.binary = true;
}