aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/hook.ts
diff options
context:
space:
mode:
authorFábio de Souza Villaça Medeiros <fabiosvm@outlook.com>2023-01-28 13:25:08 -0300
committerGitHub <noreply@github.com>2023-01-28 17:25:08 +0100
commitb3a4d27b07adae21f514c84de1e876bc8ae9b00e (patch)
tree56aba6e26560544bcfe9ee4a502401a1682c30a4 /lib/compilers/hook.ts
parent784393bbc78342197ac26ad8e9b236f55bcc74bb (diff)
downloadcompiler-explorer-b3a4d27b07adae21f514c84de1e876bc8ae9b00e.tar.gz
compiler-explorer-b3a4d27b07adae21f514c84de1e876bc8ae9b00e.zip
Fix module loading in Hook compiler (#4639)gh-5997
Diffstat (limited to 'lib/compilers/hook.ts')
-rw-r--r--lib/compilers/hook.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/compilers/hook.ts b/lib/compilers/hook.ts
index 26ebc42fe..63cf6f8fc 100644
--- a/lib/compilers/hook.ts
+++ b/lib/compilers/hook.ts
@@ -41,14 +41,19 @@ export class HookCompiler extends BaseCompiler {
return path.join(dirPath, 'example.out');
}
+ override getDefaultExecOptions(): ExecutionOptions {
+ const execOptions = super.getDefaultExecOptions();
+ const compilerPath = path.dirname(this.compiler.exe);
+ execOptions.env.HOOK_HOME = path.join(compilerPath, '..');
+ return execOptions;
+ }
+
override async runCompiler(
compiler: string,
options: string[],
inputFilename: string,
execOptions: ExecutionOptions,
): Promise<CompilationResult> {
- const compilerPath = path.dirname(compiler);
- execOptions.env.HOOK_HOME = path.join(compilerPath, '..');
const dirPath = path.dirname(inputFilename);
const outputFilename = this.getOutputFilename(dirPath);
options.push(outputFilename);