mirror of
https://github.com/nodejs/node.git
synced 2025-05-21 12:25:12 +00:00

PR-URL: https://github.com/nodejs/node/pull/18566 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
30 lines
902 B
JavaScript
30 lines
902 B
JavaScript
/* eslint-disable node-core/required-modules */
|
|
'use strict';
|
|
const path = require('path');
|
|
|
|
// If node executable is linked to shared lib, need to take care about the
|
|
// shared lib path.
|
|
exports.addLibraryPath = function(env) {
|
|
if (!process.config.variables.node_shared) {
|
|
return;
|
|
}
|
|
|
|
env = env || process.env;
|
|
|
|
env.LD_LIBRARY_PATH =
|
|
(env.LD_LIBRARY_PATH ? env.LD_LIBRARY_PATH + path.delimiter : '') +
|
|
path.join(path.dirname(process.execPath), 'lib.target');
|
|
// For AIX.
|
|
env.LIBPATH =
|
|
(env.LIBPATH ? env.LIBPATH + path.delimiter : '') +
|
|
path.join(path.dirname(process.execPath), 'lib.target');
|
|
// For Mac OSX.
|
|
env.DYLD_LIBRARY_PATH =
|
|
(env.DYLD_LIBRARY_PATH ? env.DYLD_LIBRARY_PATH + path.delimiter : '') +
|
|
path.dirname(process.execPath);
|
|
// For Windows.
|
|
env.PATH =
|
|
(env.PATH ? env.PATH + path.delimiter : '') +
|
|
path.dirname(process.execPath);
|
|
};
|