I love the language overall. Seems like standard & easier management of dependencies and compiler flags would help it thrive again.
I love the language overall. Seems like standard & easier management of dependencies and compiler flags would help it thrive again.
The example I always use: you want to use libfftw ("Fastest Fourier Transform in the West"). But the library can be compiled with (at least) two options: use floats or doubles, use threads or not. That creates (at least) four possible variants of the final library.
The only way to address this (and IIUC, Cargo for Rust does this) is to somehow have the pkg manager be a part of your build system, so that you end up with a local copy of the library, built as required.
Meson did that. You can use system packages, define your own dependency, use sub-projects (custom build option a, you mentioned) or readily available from WrapDB.
Kind of an uphill struggle this one, because there's no standard implementation of the language, nor is there a standard build system. You have to deal with multiple vendors, one of whom is Microsoft and many of whom are unwilling to change rapidly.
The dependency declaration and auto-detection is nice. But the hidden extra is WrapDB, built-in package management (if wanted):
https://mesonbuild.com/Wrap-dependency-system-manual.html
https://mesonbuild.com/Wrapdb-projects.html1. The build in step-by-step rather than end-to-end. Meaning that you first build Boost completely, then Qt, and then your application. With an end-to-end build you would build everything with a single build system invocation with the build system "seeing" the entire build graph. In particular, this would allow you to build only what's necessary and faster.
2. If something goes wrong in one of these dependencies, you better be prepare to become an expert in whatever build system it uses.
If you want a true Cargo-like experience in C++, a better option would be build2, which replaces rather than wrapps the build system (and, yes, it has Boost and Qt packages): https://build2.org
For more details on what an end-to-end build can give you, see: https://build2.org/faq.xhtml#why-package-managers