diff options
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/pythran.ts | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/compilers/pythran.ts b/lib/compilers/pythran.ts index 33fb7d981..32504d449 100644 --- a/lib/compilers/pythran.ts +++ b/lib/compilers/pythran.ts @@ -1,4 +1,7 @@ import path from 'path'; + +import {CompileChildLibraries} from '../../types/compilation/compilation.interfaces.js'; + import {BaseCompiler} from '../base-compiler.js'; import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; @@ -15,15 +18,22 @@ export class PythranCompiler extends BaseCompiler { this.cpp_compiler_root = this.compilerProps<string>(`compiler.${this.compiler.id}.cpp_compiler_root`); } - override getDefaultExecOptions() { - const execOptions = super.getDefaultExecOptions(); + override getSharedLibraryPaths(libraries: CompileChildLibraries[], dirPath?: string): string[] { + let ldpath = super.getSharedLibraryPaths(libraries, dirPath); if (this.cpp_compiler_root) { - execOptions.env.PATH = path.join(this.cpp_compiler_root, 'bin'); - const ld_library_path = [ + ldpath = ldpath.concat( path.join(this.cpp_compiler_root, 'lib'), path.join(this.cpp_compiler_root, 'lib64'), - ]; - execOptions.env.LD_LIBRARY_PATH = ld_library_path.join(':'); + ); + } + return ldpath; + } + + override getDefaultExecOptions() { + const execOptions = super.getDefaultExecOptions(); + + if (this.cpp_compiler_root) { + execOptions.env.PATH = execOptions.env.PATH + ':' + path.join(this.cpp_compiler_root, 'bin'); } return execOptions; |