Skip to content
Stefan Seefeld edited this page Dec 2, 2018 · 1 revision

Consider this use-case:

A binary artefact C is defined, to generate a binary from source C.cc. This is dependent on a configure check which may add a macro definition to the feature set.

The specification

The fabscript contains the following instructions:

config = try_compile(source, if_=define('HAS_FEATURE'))
C = binary('C', 'C.cc', features=config.use)

which correspond to the following dependency graph:

Initial state

Some processing can be done during initialization, i.e. while the fabscript is being processed:

  • the try_compile step consists of creating an (intermediate) source file as we as a step to (try to) compile it. If that succeeds, HAS_FEATURE will be defined.
  • the C binary artefact depends on an assembler step that will determine the individual steps to build it from C.cc. (Note that which steps that exactly are isn't known yet, as the choice of available tools may depend on the use features contributed from the config step...

Thus, when that stage is complete, the dependency graph is:

Sometime later

As mentioned earlier, the required steps to update C are generated in the process of updating the assembler step. So here is how the dependency graph looks like once that is completed. (all completed artefacts are green):

Clone this wiki locally