On Friday, 11 January 2013 at 14:01:48 UTC, David wrote:
also something like this for custom target:
auto builder = Builder( homepath!"./", arch!"x86",
mode!"debug" )
Doesn't work, these are compiler flags, which differ from
compiler to
compiler. You could make the builder call the compiler to set
the flag,
but I would move that directly to the compiler.
// assuming all methods returns ref to self so it could be
just simple
calls
builder.addSrcPath("path_to_src_folder_1");
// or can be chained
builder.addSrcPath("path_to_src_folder_2").
addSrcPath("path_to_src_folder3");
And how does chaining help? That makes everything just uglier.
builder.addImportPath("path_to_imports");
builder.addLinkLib("somelib.a");
Need to be set for the compiler, A C compiler doesn't need the
flags of
a D compiler
// compiler log
string log = builder.build();
The log should be in realtime to see where compilation takes
longest etc.
also to all above it would be good if there be some concept of
multiple
targets or jobs and ordering, to allow build stuff dependent
on other
stuff in one run
Everything is compiled without beeing linked, order doesn't mean
anything, because everything will be linked together.
well the topic says script in D, so i assume this is for D and
not C(there is already cmake, make and so on), and this is
possible to get compiler info in D
ugly chaining is not so ugly, and is just an option, there is
anyway "with (...)" construct in D
log is was an example and not requirement, i just say that such
class when used with CTFE somehow would be helpful to do easy
compile with all dependencies, i.e. you only compile one target
and using CTFE it compiles other, possibly messy stuff but maybe
anyone need this...
anyway that's just a wishlist, not a must have list =3