build/llvmPackages: add sysroot generator
This commit is contained in:
@@ -16,6 +16,40 @@ export interface LLVMPackageOverrides {
|
||||
spawnOverrides?: (old: SpawnOptions) => SpawnOptions,
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sysroot options suitable for LLVM build.
|
||||
*/
|
||||
export function llvmBuildSysroot(prefix: string): LLVMPackageOverrides {
|
||||
return {
|
||||
cmakeDefinitionOverrides: {
|
||||
llvm: {
|
||||
CMAKE_C_COMPILER: path.resolve(prefix, 'usr', 'bin', 'gcc'),
|
||||
CMAKE_CXX_COMPILER: path.resolve(prefix, 'usr', 'bin', 'g++'),
|
||||
CMAKE_SYSROOT: prefix,
|
||||
},
|
||||
libpgmath: {
|
||||
CMAKE_SYSROOT: prefix,
|
||||
},
|
||||
cflang: {
|
||||
|
||||
CMAKE_SYSROOT: prefix,
|
||||
},
|
||||
},
|
||||
spawnOverrides: o => ({
|
||||
...o,
|
||||
env: {
|
||||
...o.env,
|
||||
LD_LIBRARY_PATH: [
|
||||
path.resolve(prefix, 'lib'),
|
||||
path.resolve(prefix, 'usr', 'lib'),
|
||||
].join(':')
|
||||
}
|
||||
}),
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export interface LLVMPackageOptions {
|
||||
src: string;
|
||||
installPrefix: string;
|
||||
|
||||
Reference in New Issue
Block a user