-libpath?

Mike Franklin slavo5150 at yahoo.com
Wed Feb 21 04:07:38 UTC 2018


On Tuesday, 6 February 2018 at 17:49:33 UTC, Jonathan Marler 
wrote:
> What do people think of adding an argument to DMD to add 
> library search paths?  Currently the only way I know how to do 
> this would be via linker-specific flags, i.e.
>
> GCC: -L-L/usr/lib
> MSVC: -L-libpath:C:\mylibs
> OPTLINK: -L+C:\mylibs\
>
> NOTE: the optlink version only works if no .def file is 
> specified.  If you have a .def file, then you can't add any 
> library search paths :)
>
> If we added a new "linker-independent" flag to dmd, then you 
> could add paths using the same interface regardless of which 
> linker you are using.  I'd expect the argument to be something 
> like:
>
> -libpath=<some-path>
>
> The disadvantage is it would be another command line option 
> added to DMD.  If there is general agreement that this is a 
> desirable feature, I'll go ahead and implement it.

Given the current state of things, and the issue described above, 
I think a linker/platform independent flag would be nice.

However, I'd much rather have the compiler just be a compiler and 
not have to worry about all the intricacies building.  IMO, the 
compiler should get out of the linking business altogether, and 
just generate object files.  A separate build tool could then 
call the compiler, linker, and whatever else to do builds.  But 
that ship has probably sailed.

Mike


More information about the Digitalmars-d mailing list