std libraries vs. personal libraries

John Reimer John_member at pathlink.com
Sat Mar 18 07:01:23 PST 2006


In article <op.s6l0j8f26b8z09 at ginger.vic.bigpond.net.au>, Derek Parnell says...
>
>Yes. If the module 'jic.lib.misc' contains nothing that should be linked  
>in, you can add a pragma to it to stop Build from linking it.
>
>   version(build) pragma(nolink);
>
>This can be added anywhere in the 'jic.lib.misc.d' source file.
>
>Typically, you would do this if the source file only contained header info  
>and no function bodies and/or public variables.
>
>-- 
>Derek Parnell
>Melbourne, Australia

A point I was wondering about:  version(build) pragma(nolink) is certainly
useful, but in most situations these types of modules don't need to be compiled
at all since they are headers.  So wouldn't it be better (or at least more
efficient) to have a pragma that specified "nocompile" or something similar to
avoid an unnecessary step?

Currently, using the -full and -X<module> flags together on the build command
line seems to achieve this goal. -full "causes all source files, except ignored
modules, to be compiled."  But there is no equivalent in a pragma version.  This
would seem more suitable in a header-type module situation as described above.

-JJR





More information about the Digitalmars-d-learn mailing list