fix: use setupCppDir inside setupLLVM

This commit is contained in:
Amin Yahyaabadi 2021-09-20 07:14:15 -05:00
parent b9ce5945b7
commit 3dd8e43133
1 changed files with 5 additions and 14 deletions

View File

@ -230,26 +230,17 @@ async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform): P
}
}
const DEFAULT_NIX_DIRECTORY = "./llvm"
const DEFAULT_WIN32_DIRECTORY = "C:/Program Files/LLVM"
// const DEFAULT_UNIX_DIRECTORY = "./llvm"
// const DEFAULT_WIN32_DIRECTORY = "C:/Program Files/LLVM"
export async function setupLLVM(
version: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_setupCppDir: string | undefined,
setupCppDir: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_arch: string
): Promise<InstallationInfo> {
let directory = _setupCppDir
if (directory === "" || directory === undefined) {
directory = process.platform === "win32" ? DEFAULT_WIN32_DIRECTORY : DEFAULT_NIX_DIRECTORY
}
directory = path.resolve(directory)
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, directory)
await activateLLVM(directory, version)
const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupCppDir)
await activateLLVM(setupCppDir, version)
return installationInfo
}