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.

Backport-PR-URL: https://github.com/nodejs/node/pull/25681
PR-URL: https://github.com/nodejs/node/pull/23168
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Sam Ruby authored and Beth Griggs committed 2019-03-20 20:29:31 +00:00
1 parent 2b2ad96ef2
commit 63522886ea
1 file changed
+5
+5
View File
@@ -956,6 +956,11 @@
['OS=="solaris"', {
'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]
}],
[ 'node_shared=="true"', {
'xcode_settings': {
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
},
}],
],
}
], # end targets