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 }