fix: set gcc/g++ apt alternative when gcc is installed

This commit is contained in:
Amin Yahyaabadi 2022-04-24 18:11:19 -07:00
parent d35f6780f8
commit 91f233cd92
3 changed files with 6 additions and 2 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

@ -100,6 +100,8 @@ async function activateGcc(version: string, binDir: string) {
if (process.platform === "linux") {
await updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`)
await updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`)
await updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`)
await updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`)
}
} else {
addEnv("CC", `${binDir}/gcc-${version}`)
@ -108,6 +110,8 @@ async function activateGcc(version: string, binDir: string) {
if (process.platform === "linux") {
await updateAptAlternatives("cc", `${binDir}/gcc-${version}`)
await updateAptAlternatives("cxx", `${binDir}/g++-${version}`)
await updateAptAlternatives("gcc", `${binDir}/gcc-${version}`)
await updateAptAlternatives("g++", `${binDir}/g++-${version}`)
}
}
}