cpubench: add ldflags config

This commit is contained in:
2025-05-23 22:16:47 +08:00
parent 345398b8a5
commit 4aa53ef9c7
2 changed files with 4 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ CXXFLAGS = ${OPTIMIZE}
CLD = # Example: ${CC} CLD = # Example: ${CC}
CXXLD = # Example: ${CXX} CXXLD = # Example: ${CXX}
FLD = # Example: ${FC} FLD = # Example: ${FC}
LD_FLAGS = LD_FLAGS = @@LDFLAGS@@
#=============================LIBS Flags============================== #=============================LIBS Flags==============================
LIBS = # Example: -lpthread LIBS = # Example: -lpthread

View File

@@ -5,11 +5,13 @@ export interface CPUBenchConfigOptions {
llvmInstall: string; llvmInstall: string;
optimize: string[]; optimize: string[];
benchmarks: string[]; benchmarks: string[];
ldflags: string[];
} }
export function renderConfig({ llvmInstall, optimize, benchmarks }: CPUBenchConfigOptions) { export function renderConfig({ llvmInstall, optimize, benchmarks, ldflags }: CPUBenchConfigOptions) {
return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n` + cpuBenchTemplate return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n` + cpuBenchTemplate
.replace('@@LLVM_INSTALL@@', llvmInstall) .replace('@@LLVM_INSTALL@@', llvmInstall)
.replace('@@OPTIMIZE@@', optimize.join(' ')) .replace('@@OPTIMIZE@@', optimize.join(' '))
.replace('@@LDFLAGS@@', ldflags.join(' '))
.replace('@@BENCHMARKS@@', benchmarks.join(',')); .replace('@@BENCHMARKS@@', benchmarks.join(','));
} }