mirror of https://github.com/aminya/setup-cpp
fix: update the alternatives only on ubuntu
This commit is contained in:
parent
85e2f07bbe
commit
cefca0b72e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -14,6 +14,7 @@ import { addBinExtension } from "../utils/extension/extension"
|
|||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { extract7Zip } from "../utils/setup/extract"
|
||||
import { isArch } from "../utils/env/isArch"
|
||||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
|
||||
interface MingwInfo {
|
||||
releaseName: string
|
||||
|
@ -159,7 +160,7 @@ async function activateGcc(version: string, binDir: string) {
|
|||
if (majorVersion >= 5) {
|
||||
promises.push(addEnv("CC", `${binDir}/gcc-${majorVersion}`), addEnv("CXX", `${binDir}/g++-${majorVersion}`))
|
||||
|
||||
if (process.platform === "linux") {
|
||||
if (isUbuntu()) {
|
||||
updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`)
|
||||
updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`)
|
||||
updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`)
|
||||
|
@ -168,7 +169,7 @@ async function activateGcc(version: string, binDir: string) {
|
|||
} else {
|
||||
promises.push(addEnv("CC", `${binDir}/gcc-${version}`), addEnv("CXX", `${binDir}/g++-${version}`))
|
||||
|
||||
if (process.platform === "linux") {
|
||||
if (isUbuntu()) {
|
||||
updateAptAlternatives("cc", `${binDir}/gcc-${version}`)
|
||||
updateAptAlternatives("cxx", `${binDir}/g++-${version}`)
|
||||
updateAptAlternatives("gcc", `${binDir}/gcc-${version}`)
|
||||
|
|
|
@ -21,6 +21,7 @@ import { isGitHubCI } from "../utils/env/isci"
|
|||
import { setupGcc } from "../gcc/gcc"
|
||||
import { getVersion } from "../default_versions"
|
||||
import { isArch } from "../utils/env/isArch"
|
||||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
|
||||
//================================================
|
||||
// Version
|
||||
|
@ -339,7 +340,7 @@ export async function activateLLVM(directory: string, versionGiven: string) {
|
|||
}
|
||||
}
|
||||
|
||||
if (process.platform === "linux") {
|
||||
if (isUbuntu()) {
|
||||
updateAptAlternatives("cc", `${directory}/bin/clang`)
|
||||
updateAptAlternatives("cxx", `${directory}/bin/clang++`)
|
||||
updateAptAlternatives("clang", `${directory}/bin/clang`)
|
||||
|
|
Loading…
Reference in New Issue