[build2] Build2 configuration for component based projects

asatsuyu at tutanota.com asatsuyu at tutanota.com
Wed Nov 8 01:27:43 UTC 2017

I would like to use build2 for building a project whose structure is slightly different from the one introduced in the cppcon talk given by Boris in 2016. After simplification, the project tree would look like the following:
 ├── bld
 │   ├── cfg_A
 │   │   └── build
 │   │       ├── bootstrap
 │   │       │   └── src-root.build
 │   │       └── config.build
 │   └── cfg_B
 │       └── build
 │           ├── bootstrap
 │           │   └── src-root.build
 │           └── config.build
 └── src
     ├── build
     │   ├── bootstrap.build
     │   └── root.build
     ├── buildfile
     ├── cde
     │   ├── cde_XXX.cpp
     │   ├── cde_XXX.hpp
     │   ├── cde_XXX.t.cpp
     │   ├── cde_YYY.cpp
     │   ├── cde_YYY.hpp
     │   └── cde_YYY.t.cpp
     └── efg
         ├── efg_ZZZ.cpp
         ├── efg_ZZZ.hpp
         └── efg_ZZZ.t.cpp
 The code under the src directory is organized in "components" and each "component" is made up of three files (this is rather common I guess):
 - One .hpp file which contains function/struct/class declarations and inline/template functions implementations.
 - One .cpp file which contains the implementation of the non inline/template functions declared in the associated .hpp file.
 - One .t.cpp file which contains the test driver with a function for the function/struct/class declared in the associated .hpp file. In particular, there is a "int main(...)" function in this file. When running the test driver binary, errors are reported onthe standard output (if any) and exit code indicates the status (0 if no error, 1 otherwise).
 The description is probably oversimplified but that would already be nice to get the following tasks to work without having to modify the buildfile for each newly added component.
 - build the new/outdated object files (XXX.o and XXX.t.o)
 - build the new/outdated/failed test driver binary (XXX.t), run them and report failures if any.
 Do you think that build2 could help to achieve that? If so, could you provide some guidelines on how to set it up for that purpose?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20171108/6f746fac/attachment.html>

More information about the users mailing list