D and SCons

Russel Winder russel at winder.org.uk
Sun Sep 9 08:48:55 PDT 2012


On Sun, 2012-09-09 at 08:05 -0700, Ali Çehreli wrote:
[…]
> Similar to pragmas in C and C++, D pragmas allow language extensions: 
> "Pragmas are a way to pass special information to the compiler and to 
> add vendor specific extensions to D."
> 
>    http://dlang.org/pragma.html

This states that:

	pragma(lib, "blah.lib")

is a part of the D language and not just a DMD extension.  This means
that the code is platform specific (due to extensions embedded in code)
as well as predicating that the toolchain will deal with explicit
toolchain information in the source code.

Personally I would say that putting dependencies such as this in the
source code is anathema, it is the role of the build framework to deal
with this. That way you can deal with the platform specific extensions
and naming as well as toolchain issues. These dependencies are link time
not source time ones.

So I am with Johannes, pragma(lib,…) is "evil" and should be removed.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120909/a861acb4/attachment-0001.pgp>


More information about the Digitalmars-d-learn mailing list