www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - About Dub capabilities

reply Dukc <ajieskola gmail.com> writes:
When you want to do things other than just fetching packages, 
invoking D compilers and converting package descriptors, I am 
wondering is Dub up to it?

For example, could dmd source code build (if somebody wanted to) 
be automated with Dub instead of CMake, bearing in mind it 
requires some c++ compilation?

If so, how? I was unable to find anything about custom system 
calls at the website.

Not that I have any need for that right now, I am just interested.
Jul 04 2017
parent reply Martin Nowak <code dawg.eu> writes:
On Tuesday, 4 July 2017 at 20:46:33 UTC, Dukc wrote:
 Not that I have any need for that right now, I am just 
 interested.
preGenerate-/preBuildCommands are your friends to compile C++ code using dub. You'd invoke make or sth. and add the generated libs/objects to dub's sourceFiles. http://code.dlang.org/package-format?lang=json#build-settings Dub can also generate scripts for other build systems (among them cmake), in case that seems more suitable for your needs.
Jul 04 2017
parent reply Dukc <ajieskola gmail.com> writes:
On Tuesday, 4 July 2017 at 21:02:55 UTC, Martin Nowak wrote:
 preGenerate-/preBuildCommands are your friends to compile C++ 
 code using dub.
Hod did I not notice them... but that answers the question, thanks.
Jul 04 2017
parent Seb <seb wilzba.ch> writes:
On Wednesday, 5 July 2017 at 06:06:18 UTC, Dukc wrote:
 On Tuesday, 4 July 2017 at 21:02:55 UTC, Martin Nowak wrote:
 preGenerate-/preBuildCommands are your friends to compile C++ 
 code using dub.
Hod did I not notice them... but that answers the question, thanks.
See https://github.com/dlang-community/drepl/pull/63 for an example on how simple c/c++ files can be compiled "on-the-fly".
Jul 05 2017