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}
CXXLD = # Example: ${CXX}
FLD = # Example: ${FC}
LD_FLAGS =
LD_FLAGS = @@LDFLAGS@@
#=============================LIBS Flags==============================
LIBS = # Example: -lpthread

View File

@@ -5,11 +5,13 @@ export interface CPUBenchConfigOptions {
llvmInstall: string;
optimize: 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
.replace('@@LLVM_INSTALL@@', llvmInstall)
.replace('@@OPTIMIZE@@', optimize.join(' '))
.replace('@@LDFLAGS@@', ldflags.join(' '))
.replace('@@BENCHMARKS@@', benchmarks.join(','));
}