Thread overview |
---|
November 12, 2019 rpath on macOS | ||||
---|---|---|---|---|
| ||||
On Linux, this works: ------------ name "myapp" targetType "executable" description "A minimal D application." authors "bartland" copyright "Copyright © 2019, bartland" license "public" libs "mylib" lflags "-L../../_cache/" "-rpath=../../_cache/" ------------ but on macOS with DMD or LDC this gives ------------ ld: unknown option: -rpath=../../_cache/" ------------ |
November 12, 2019 Re: rpath on macOS | ||||
---|---|---|---|---|
| ||||
Posted in reply to cartland | On Tuesday, 12 November 2019 at 10:19:30 UTC, cartland wrote:
> On Linux, this works:
>
> ------------
> *snip*
>
> but on macOS with DMD or LDC this gives
>
> ------------
> ld: unknown option: -rpath=../../_cache/"
> ------------
Currently I do this post build to get the binary to work:
----------
install_name_tool -add_rpath "../../_cache" myapp
----------
|
November 12, 2019 Re: rpath on macOS | ||||
---|---|---|---|---|
| ||||
Posted in reply to cartland | On Tuesday, 12 November 2019 at 10:19:30 UTC, cartland wrote:
> but on macOS with DMD or LDC this gives
>
> ------------
> ld: unknown option: -rpath=../../_cache/"
> ------------
IIRC, Mac's ld64 linker requires 2 separated args: "-rpath" "../../_cache/"
|
November 12, 2019 (SOLVED) Re: rpath on macOS | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinke | On Tuesday, 12 November 2019 at 10:44:07 UTC, kinke wrote:
> On Tuesday, 12 November 2019 at 10:19:30 UTC, cartland wrote:
>> but on macOS with DMD or LDC this gives
>>
>> ------------
>> ld: unknown option: -rpath=../../_cache/"
>> ------------
>
> IIRC, Mac's ld64 linker requires 2 separated args: "-rpath" "../../_cache/"
Brilliant.
lflags "-L../../_cache/" "-rpath" "../../_cache/"
also works on Linux.
Thanks
|
Copyright © 1999-2021 by the D Language Foundation