From 49b0ec4fe781e774b56d0bfd18a73b11b15e34a5 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sat, 29 Sep 2018 16:43:39 -0400 Subject: [PATCH] build: add loader path to rpath for cctest Building on Mac OS/X as follows: ``` ./configure --shared make -j4 test ``` Results in: ``` dyld: Library not loaded: @rpath/libnode.67.dylib Referenced from: /Users/rubys/git/node-shared/out/Release/cctest Reason: image not found make: *** [cctest] Abort trap: 6 ``` This change adds the loader path to the runtime path for the `cctest` executable. PR-URL: https://github.com/nodejs/node/pull/23168 Reviewed-By: Richard Lau Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- node.gyp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node.gyp b/node.gyp index aa0db23c2e894a..72b045e31aa7e9 100644 --- a/node.gyp +++ b/node.gyp @@ -959,6 +959,11 @@ [ 'OS=="win" and node_shared=="true"', { 'type': 'none', }], + [ 'node_shared=="true"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ], + }, + }], ], }, # cctest ], # end targets