@@ -78,7 +78,7 @@ function getGccPackageInfo(version: string, platform: NodeJS.Platform, arch: str
78
78
}
79
79
80
80
// eslint-disable-next-line @typescript-eslint/no-unused-vars
81
- export async function setupGcc ( version : string , setupDir : string , arch : string ) {
81
+ export async function setupGcc ( version : string , setupDir : string , arch : string , priority : number = 40 ) {
82
82
let installationInfo : InstallationInfo | undefined
83
83
switch ( process . platform ) {
84
84
case "win32" : {
@@ -139,7 +139,7 @@ export async function setupGcc(version: string, setupDir: string, arch: string)
139
139
}
140
140
}
141
141
if ( installationInfo !== undefined ) {
142
- await activateGcc ( version , installationInfo . binDir )
142
+ await activateGcc ( version , installationInfo . binDir , priority )
143
143
return installationInfo
144
144
}
145
145
return undefined
@@ -199,7 +199,7 @@ async function setupChocoMingw(version: string, arch: string): Promise<Installat
199
199
return undefined
200
200
}
201
201
202
- async function activateGcc ( version : string , binDir : string ) {
202
+ async function activateGcc ( version : string , binDir : string , priority : number = 40 ) {
203
203
const promises : Promise < void | ExecaReturnValue < string > > [ ] = [ ]
204
204
// Setup gcc as the compiler
205
205
@@ -223,21 +223,21 @@ async function activateGcc(version: string, binDir: string) {
223
223
224
224
if ( isUbuntu ( ) ) {
225
225
promises . push (
226
- updateAptAlternatives ( "cc" , `${ binDir } /gcc-${ majorVersion } ` ) ,
227
- updateAptAlternatives ( "cxx" , `${ binDir } /g++-${ majorVersion } ` ) ,
228
- updateAptAlternatives ( "gcc" , `${ binDir } /gcc-${ majorVersion } ` ) ,
229
- updateAptAlternatives ( "g++" , `${ binDir } /g++-${ majorVersion } ` ) ,
226
+ updateAptAlternatives ( "cc" , `${ binDir } /gcc-${ majorVersion } ` , priority ) ,
227
+ updateAptAlternatives ( "cxx" , `${ binDir } /g++-${ majorVersion } ` , priority ) ,
228
+ updateAptAlternatives ( "gcc" , `${ binDir } /gcc-${ majorVersion } ` , priority ) ,
229
+ updateAptAlternatives ( "g++" , `${ binDir } /g++-${ majorVersion } ` , priority ) ,
230
230
)
231
231
}
232
232
} else {
233
233
promises . push ( addEnv ( "CC" , `${ binDir } /gcc-${ version } ` ) , addEnv ( "CXX" , `${ binDir } /g++-${ version } ` ) )
234
234
235
235
if ( isUbuntu ( ) ) {
236
236
promises . push (
237
- updateAptAlternatives ( "cc" , `${ binDir } /gcc-${ version } ` ) ,
238
- updateAptAlternatives ( "cxx" , `${ binDir } /g++-${ version } ` ) ,
239
- updateAptAlternatives ( "gcc" , `${ binDir } /gcc-${ version } ` ) ,
240
- updateAptAlternatives ( "g++" , `${ binDir } /g++-${ version } ` ) ,
237
+ updateAptAlternatives ( "cc" , `${ binDir } /gcc-${ version } ` , priority ) ,
238
+ updateAptAlternatives ( "cxx" , `${ binDir } /g++-${ version } ` , priority ) ,
239
+ updateAptAlternatives ( "gcc" , `${ binDir } /gcc-${ version } ` , priority ) ,
240
+ updateAptAlternatives ( "g++" , `${ binDir } /g++-${ version } ` , priority ) ,
241
241
)
242
242
}
243
243
}
0 commit comments