aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/zig.js
diff options
context:
space:
mode:
authorRubén Rincón Blanco <ruben@rinconblanco.es>2022-08-25 21:45:59 +0200
committerGitHub <noreply@github.com>2022-08-25 21:45:59 +0200
commit105b814acfc3f8b0286d0f59f3204be3dec3f9d3 (patch)
tree7e9aa8956519113baf75e5f3a5bafa742178a4da /lib/compilers/zig.js
parent7c6a5291abdae74270c4462de29b086bdd67bb30 (diff)
downloadcompiler-explorer-105b814acfc3f8b0286d0f59f3204be3dec3f9d3.tar.gz
compiler-explorer-105b814acfc3f8b0286d0f59f3204be3dec3f9d3.zip
Fixes wrong types in libraries.interfaces.ts (#3982)gh-4021
* Fix getLibrary functions * Fix library.path usage in Zig compiler
Diffstat (limited to 'lib/compilers/zig.js')
-rw-r--r--lib/compilers/zig.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/compilers/zig.js b/lib/compilers/zig.js
index 1a9d0512d..d524fc1de 100644
--- a/lib/compilers/zig.js
+++ b/lib/compilers/zig.js
@@ -132,14 +132,12 @@ export class ZigCompiler extends BaseCompiler {
}
getIncludeArguments(libraries) {
- return _.flatten(
- _.map(libraries, selectedLib => {
- const foundVersion = this.findLibVersion(selectedLib);
- if (!foundVersion) return false;
- // Zig should not have more than 1 path
- return ['--pkg-begin', foundVersion.name, foundVersion.path, '--pkg-end'];
- }),
- );
+ return libraries.flatMap(selectedLib => {
+ const foundVersion = this.findLibVersion(selectedLib);
+ if (!foundVersion) return [];
+ // Zig should not have more than 1 path, but it's still an array so spread it
+ return ['--pkg-begin', foundVersion.name, ...foundVersion.path, '--pkg-end'];
+ });
}
getIrOutputFilename(inputFilename) {