build/llvmPackages: use a function to compute build directories

This commit is contained in:
2024-07-19 18:07:43 +08:00
parent 431d03624b
commit 78f4885647

View File

@@ -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 () => {