fix: use older default versions for gcovr, meson, doxygen on ubuntu 18

This commit is contained in:
Amin Yahyaabadi 2022-05-20 18:51:32 -07:00
parent af7a395e60
commit 86e88d8ce2
3 changed files with 19 additions and 6 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,15 +19,28 @@ const DefaultVersions: Record<string, string> = {
/** Get the default version if passed true or undefined, otherwise return the version itself */ /** Get the default version if passed true or undefined, otherwise return the version itself */
export function getVersion(name: string, version: string | undefined, osVersion: number[] | null = null) { export function getVersion(name: string, version: string | undefined, osVersion: number[] | null = null) {
if (useDefault(version, name)) { if (useDefault(version, name)) {
// llvm on linux // choose the default linux version based on ubuntu version
if (process.platform === "linux" && ["llvm", "clangtidy", "clangformat"].includes(name)) { if (process.platform === "linux" && osVersion !== null) {
// choose the default version for llvm based on ubuntu if (["llvm", "clangtidy", "clangformat"].includes(name)) {
if (osVersion !== null) {
if ([20, 18, 16].includes(osVersion[0]) && osVersion[1] === 4) { if ([20, 18, 16].includes(osVersion[0]) && osVersion[1] === 4) {
return `${osVersion[0] === 18 ? "13.0.1" : "13.0.0"}-ubuntu-${osVersion[0]}.0${osVersion[1]}` return `${osVersion[0] === 18 ? "13.0.1" : "13.0.0"}-ubuntu-${osVersion[0]}.0${osVersion[1]}`
} }
} }
if (osVersion[0] < 20) {
switch (name) {
case "gcovr":
return "5.0"
case "meson":
return "0.61.4"
case "doxygen":
return "1.9.1"
default: {
// nothing
} }
}
}
}
// anything else // anything else
return DefaultVersions[name] return DefaultVersions[name]
} else { } else {