How to specify environment variables without expansion in gyp files?

StackOverflow https://stackoverflow.com/questions/22252591

  •  11-06-2023
  •  | 
  •  

문제

I want to specify an rpath, like this:

'ldflags': [
  '-rpath', '/usr/$LIB/myprog',
],

But when I check the resulting binary, I see it has another rpath:

$ objdump -x binary | grep RPATH
  RPATH                /usr//myprog:$ORIGIN/lib/

What I want is: /usr/$LIB/myprog:...

도움이 되었습니까?

해결책

The one should do the following:

'ldflags': [
  '-rpath', '/usr/\$$LIB/myprog',
],
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top