From 78f4885647c2802c10e76a9a5e5665ce77f19f5a Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Fri, 19 Jul 2024 18:07:43 +0800 Subject: [PATCH] build/llvmPackages: use a function to compute build directories --- src/build/llvmPackages.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/build/llvmPackages.ts b/src/build/llvmPackages.ts index 76de635..390ed3e 100644 --- a/src/build/llvmPackages.ts +++ b/src/build/llvmPackages.ts @@ -57,11 +57,7 @@ export interface LLVMPackageOptions { /** * Build directories suitable for these three packages. */ - buildDirs: { - llvm: string; - cflang: string; - libpgmath: string; - }; + buildDir: (packageName: 'llvm' | 'libpgmath' | 'cflang') => string, platform: PackagePlatform; }; @@ -70,7 +66,7 @@ export function llvmPackages({ src, installPrefix, platform, - buildDirs, + buildDir, cmakeDefinitionOverrides, spawnOverrides, }: LLVMPackageOptions & LLVMPackageOverrides): PackageTask[] { @@ -110,7 +106,7 @@ export function llvmPackages({ }); function mkLLVMPackage(): PackageTask { - const build = buildDirs.llvm; + const build = buildDir('llvm'); return { name: "llvm", platform, @@ -145,7 +141,7 @@ export function llvmPackages({ } function mkLibpgmathPackage(): PackageTask { - const build = buildDirs.libpgmath; + const build = buildDir('libpgmath'); return { name: "libpgmath", configurePhase: async () => { @@ -174,7 +170,7 @@ export function llvmPackages({ } function mkCflangPackage(): PackageTask { - const build = buildDirs.cflang; + const build = buildDir('cflang'); return { name: "cflang", configurePhase: async () => {