D and SCons

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue May 2 15:39:14 PDT 2017


On Wed, May 03, 2017 at 12:05:48AM +0200, Dmitry Olshansky via Digitalmars-d wrote:
> On 5/2/17 2:20 PM, Russel Winder via Digitalmars-d wrote:
> > Hi,
> > 
> > Prompted by Bill Deegan (*), I have started a SCons wiki page on D
> > support. Even if you do not actually use SCons for D code, if you
> > are interested in D you are interested in this page as it is another
> > marketing vector for D.
> > 
> 
> I've come to like SCons for my C++ projects. Way more so than say
> CMake.  It would be awesome to have full-fledged support for D there
> esp. in mixed C++ with D setup.
[...]

I've been using SCons for many years now for both C/C++ and D projects,
and have been a happy camper.

However, I have to confess that I found Russel's D tooling (the last
time I tried it anyway, which was a while back) not quite up to what I'd
like it to do. As a result, in my recent projects I've resorted simply
to:

	env = Environment(DMD = '/path/to/dmd', DMDFLAGS = [ ... ])
	env.Command('myprogram', Split("""
			myprogram.d
			module1.d
			module2.d
		"""),
		"$DMD $DMDFLAGS -of$TARGET $SOURCES"
	)

I realize this hamfisted approach doesn't work well in larger projects
or mixed D/C/C++ projects because it doesn't integrate with SCons'
built-in C/C++ support, but in practice I've found that trying to
integrate D builds with the C/C++ separate compilation model ends up
causing more headaches than necessary, so I just opted for the lazy way
out.


T

-- 
Winners never quit, quitters never win. But those who never quit AND never win are idiots.


More information about the Digitalmars-d mailing list