SCons D support
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu May 10 21:36:04 PDT 2012
On Thu, May 10, 2012 at 09:11:37PM -0700, H. S. Teoh wrote:
[...]
> Just confirmed that the new SCons module works flawlessly with a
> simple test program (consisting of two D source files).
[...]
P.S. Just confirmed that everything still works when I throw a C file
into the mix.
I tried specifying DC='dmd' in the Environment, just to see if things
worked correctly with dmd. It didn't work the first time--complained
about a whole bunch of undefined symbols during linking, but then I
realized that it was because dmd required its own version of phobos, so
I needed to specify LIBPATH and LIBS as well. After this, everything
worked with dmd.
There is a small glitch, though: -lgphobos2 is still inserted into the
linker command-line, even though I already manually specified -lphobos2.
Probably the tool needs to detect dmd and replace -lgphobos2 with
-lphobos2?
Anyway, for your reference, here's my SConstruct:
env = Environment(
DC = '/usr/src/d/dmd/src/dmd',
DFLAGS = '-m64',
LIBPATH = '/usr/src/d/phobos/generated/linux/release/64',
LIBS = 'phobos2'
)
env.Program('proj', Split("""
proj.d
mod1.d
cmod.c
"""))
T
--
Век живи - век учись. А дураком помрёшь.
More information about the Digitalmars-d
mailing list