www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Relative lflag paths in dub on Windows

reply jmh530 <john.michael.hall gmail.com> writes:
Is it possible to set relative -L paths on dub for Windows? 
Absolute paths work fine, just can't get relative paths working.

I was looking at the thread here
https://forum.dlang.org/post/dkwqrwzwqbrnaamlvtld forum.dlang.org
and came up with something like
{
     ...
     "lflags": ["-L-L..\\libs\\"],
}

where the file structure contains folders dubproject\libs and 
dubproject\source.

It didn't work though.
Jun 27
parent reply Mike Parker <aldacron gmail.com> writes:
On Tuesday, 27 June 2017 at 19:07:49 UTC, jmh530 wrote:
 Is it possible to set relative -L paths on dub for Windows? 
 Absolute paths work fine, just can't get relative paths working.

 I was looking at the thread here
 https://forum.dlang.org/post/dkwqrwzwqbrnaamlvtld forum.dlang.org
 and came up with something like
 {
     ...
     "lflags": ["-L-L..\\libs\\"],
 }

 where the file structure contains folders dubproject\libs and 
 dubproject\source.

 It didn't work though.
You have to specify the appropriate linker option, e.g. -L-option. For gcc, that happens to -L, so you get -L-L. For optlink it's +something and for the MS linker it's /something. I'm on my phone else I'd look it up.
Jun 27
parent reply Mike Parker <aldacron gmail.com> writes:
On Wednesday, 28 June 2017 at 00:16:23 UTC, Mike Parker wrote:
 On Tuesday, 27 June 2017 at 19:07:49 UTC,

 You have to specify the appropriate linker option, e.g. 
 -L-option. For gcc, that happens to -L, so you get -L-L. For 
 optlink it's +something and for the MS linker it's /something. 
 I'm on my phone else I'd look it up.
Optlink instructions at [1]: -L+path\ MS linker [2]: -L/LIBPATH:path [1] https://wiki.dlang.org/Compiling_and_linking_with_DMD_on_Windows [2] https://docs.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath
Jun 27
parent jmh530 <john.michael.hall gmail.com> writes:
On Wednesday, 28 June 2017 at 00:22:56 UTC, Mike Parker wrote:
 On Wednesday, 28 June 2017 at 00:16:23 UTC, Mike Parker wrote:
 On Tuesday, 27 June 2017 at 19:07:49 UTC,

 You have to specify the appropriate linker option, e.g. 
 -L-option. For gcc, that happens to -L, so you get -L-L. For 
 optlink it's +something and for the MS linker it's /something. 
 I'm on my phone else I'd look it up.
Optlink instructions at [1]: -L+path\ MS linker [2]: -L/LIBPATH:path [1] https://wiki.dlang.org/Compiling_and_linking_with_DMD_on_Windows [2] https://docs.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath
I appreciate you posting this. I had found the /LIBPATH, but dub randomly crapped out on me before I was about to test it, so I'm going to start another thread just on that...
Jun 28