aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/zig.js
diff options
context:
space:
mode:
authorPatrick Quist <partouf@gmail.com>2022-08-25 21:52:09 +0200
committerGitHub <noreply@github.com>2022-08-25 21:52:09 +0200
commit5b485d36e3708e192b63400d3bc30bb22cf33330 (patch)
treea6db770b803b7b6e82fa7224f331b38b7797f220 /lib/compilers/zig.js
parent098e0abc4dc870278f1ab4c060c420a5999b54b3 (diff)
parent16dca9d307220229b80327ea0998c4cecec9137b (diff)
downloadcompiler-explorer-gh-4023.tar.gz
compiler-explorer-gh-4023.zip
Merge branch 'main' into z88dkgh-4023
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) {