Eyevinn/node-srt

libsrt library link fails on some platforms due to assumed lib path from srt dependency

jsbohnert opened this issue · 1 comments

The library specified in binding.gyp assumes that the libsrt.a file generated by the srt dependency will be present in the folder deps/build/lib/.

Depending on the exact platform used to build the project, this can be a different name. In my case (CentOS 7 64bit Linux), the srt dependency installs to deps/build/lib64/ and the build of node-srt fails:

> @eyevinn/srt@0.4.0 rebuild /home/james/code/srt4w/subprojects/node-srt
> $(npm bin)/node-gyp rebuild -j $(echo "console.log(require('os').cpus().length)" | node)

make: Entering directory `/home/james/code/srt4w/subprojects/node-srt/build'
  CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
  AR(target) Release/obj.target/node_modules/node-addon-api/nothing.a
  COPY Release/nothing.a
  CXX(target) Release/obj.target/node_srt/src/binding.o
  CXX(target) Release/obj.target/node_srt/src/node-srt.o
In file included from ../src/node-srt.cc:9:0:
../src/srt-enums.h:59:23: warning: backslash-newline at end of file [enabled by default]
 #define SOCKET_STATUS \
 ^
  SOLINK_MODULE(target) Release/obj.target/node_srt.node
g++: error: /home/james/code/srt4w/subprojects/node-srt/deps/build/lib/libsrt.a: No such file or directory

Within the srt project the actual folder used is defaulted from CMake's GNUInstallDirs defaults for the platform, if not configured deliberately.

birme commented

Thanks for reporting this issue!