bin/cpubench: init
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { projectRoot } from '../environment/index.js';
|
||||
import cpuBenchTemplate from '../../assets/CPUBenchTemplate.ini';
|
||||
|
||||
const cpubenchTemplate = fs.readFileSync(path.resolve(projectRoot, 'assets', 'CPUBenchTemplate.ini')).toString('utf-8');
|
||||
|
||||
export interface CPUBenchConfigOptions {
|
||||
llvmInstall: string;
|
||||
optimize: string[];
|
||||
sysroot: string;
|
||||
}
|
||||
|
||||
export function renderConfig({ llvmInstall, optimize }: CPUBenchConfigOptions) {
|
||||
return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n` + cpubenchTemplate
|
||||
export function renderConfig({ llvmInstall, optimize, sysroot }: CPUBenchConfigOptions) {
|
||||
return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n` + cpuBenchTemplate
|
||||
.replace('@@LLVM_INSTALL@@', llvmInstall)
|
||||
.replace('@@OPTIMIZE@@', optimize.join(' '));
|
||||
.replace('@@OPTIMIZE@@', optimize.join(' '))
|
||||
.replace('@@SYSROOT@@', sysroot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user