From b9ce5945b751ad7c153bd246c7eaff5cd012b54b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 20 Sep 2021 07:10:40 -0500 Subject: [PATCH] feat: add activateLLVM --- src/llvm/llvm.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/llvm/llvm.ts b/src/llvm/llvm.ts index 9cd07b27..e7983a59 100644 --- a/src/llvm/llvm.ts +++ b/src/llvm/llvm.ts @@ -216,12 +216,9 @@ export function getUrl(platform: string, version: string): string | null | Promi } //================================================ -// Action +// Exports //================================================ -const DEFAULT_NIX_DIRECTORY = "./llvm" -const DEFAULT_WIN32_DIRECTORY = "C:/Program Files/LLVM" - async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform): Promise { const [specificVersion, url] = await getSpecificVersionAndUrl(VERSIONS, platform, version, getUrl) core.setOutput("version", specificVersion) @@ -233,6 +230,9 @@ async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform): P } } +const DEFAULT_NIX_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 @@ -249,7 +249,11 @@ export async function setupLLVM( const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, directory) - // Adding environment variables + await activateLLVM(directory, version) + return installationInfo +} + +export async function activateLLVM(directory: string, version: string) { const lib = path.join(directory, "lib") const ld = process.env.LD_LIBRARY_PATH ?? "" @@ -284,6 +288,4 @@ export async function setupLLVM( core.error(e as Error | string) } } - - return installationInfo }