feat: add activateGcc

This commit is contained in:
Amin Yahyaabadi 2021-09-20 07:25:41 -05:00
parent 44478af66e
commit b7eaefbab7
3 changed files with 24 additions and 24 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

@ -54,21 +54,24 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri
} }
} }
if (binDir !== undefined) { if (binDir !== undefined) {
activateGcc(version, binDir)
return { binDir }
}
return undefined
}
function activateGcc(version: string, binDir: string) {
const majorVersion = semverMajor(semverCoerce(version) ?? version) const majorVersion = semverMajor(semverCoerce(version) ?? version)
// TODO // TODO
// const ld = process.env.LD_LIBRARY_PATH ?? "" // const ld = process.env.LD_LIBRARY_PATH ?? ""
// const dyld = process.env.DYLD_LIBRARY_PATH ?? "" // const dyld = process.env.DYLD_LIBRARY_PATH ?? ""
// // Setup gcc as the compiler // // Setup gcc as the compiler
// exportVariable("LD_LIBRARY_PATH", `${installDir}/lib${path.delimiter}${ld}`) // exportVariable("LD_LIBRARY_PATH", `${installDir}/lib${path.delimiter}${ld}`)
// exportVariable("DYLD_LIBRARY_PATH", `${installDir}/lib${path.delimiter}${dyld}`) // exportVariable("DYLD_LIBRARY_PATH", `${installDir}/lib${path.delimiter}${dyld}`)
// exportVariable("CPATH", `${installDir}/lib/gcc/${majorVersion}/include`) // exportVariable("CPATH", `${installDir}/lib/gcc/${majorVersion}/include`)
// exportVariable("LDFLAGS", `-L${installDir}/lib`) // exportVariable("LDFLAGS", `-L${installDir}/lib`)
// exportVariable("CPPFLAGS", `-I${installDir}/include`) // exportVariable("CPPFLAGS", `-I${installDir}/include`)
if (process.platform === "win32") { if (process.platform === "win32") {
exportVariable("CC", `${binDir}/gcc`) exportVariable("CC", `${binDir}/gcc`)
exportVariable("CXX", `${binDir}/g++`) exportVariable("CXX", `${binDir}/g++`)
@ -76,7 +79,4 @@ export async function setupGcc(version: string, _setupCppDir: string, arch: stri
exportVariable("CC", `${binDir}/gcc-${majorVersion}`) exportVariable("CC", `${binDir}/gcc-${majorVersion}`)
exportVariable("CXX", `${binDir}/g++-${majorVersion}`) exportVariable("CXX", `${binDir}/g++-${majorVersion}`)
} }
return { binDir }
}
return undefined
} }