diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base-compiler.ts | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index 4631aa292..46a9465cd 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -31,7 +31,10 @@ import _ from 'underscore'; import { BuildResult, + CompilationCacheKey, + CompilationInfo, CompilationResult, + CustomInputForTool, ExecutionOptions, ToolResult, } from '../types/compilation/compilation.interfaces'; @@ -294,7 +297,7 @@ export class BaseCompiler { return exec.execute(filepath, args, execOptions); } - protected getCompilerCacheKey(compiler, args, options) { + protected getCompilerCacheKey(compiler, args, options): CompilationCacheKey { return {mtime: this.mtime, compiler, args, options}; } @@ -1599,20 +1602,22 @@ export class BaseCompiler { return cacheKey; } - getCompilationInfo(key, result, customBuildPath?) { - const compilationinfo = Object.assign({}, key, result); - compilationinfo.outputFilename = this.getOutputFilename( - customBuildPath || result.dirPath, - this.outputFilebase, - key, - ); - compilationinfo.executableFilename = this.getExecutableFilename( - customBuildPath || result.dirPath, - this.outputFilebase, - key, - ); - compilationinfo.asmParser = this.asm; - return compilationinfo; + getCompilationInfo( + key: CompilationCacheKey, + result: CompilationResult | CustomInputForTool, + customBuildPath?: string, + ): CompilationInfo { + return { + outputFilename: this.getOutputFilename(customBuildPath || result.dirPath || '', this.outputFilebase, key), + executableFilename: this.getExecutableFilename( + customBuildPath || result.dirPath || '', + this.outputFilebase, + key, + ), + asmParser: this.asm, + ...key, + ...result, + }; } tryAutodetectLibraries(libsAndOptions) { |