![]() ![]() Users who have the library already installed don’t have a penalty for compilation, only those who don’t have it.Īnd if someone doesn’t have it and sees that it is going to be compiled, can look for a different way to get it. Thus I decided to go with a mix of 1)/2): first look for a pre-compiled binary on the system and only if none is found, fetch the sources and build. I cannot understand how people can program there. I really wish I could just delegate package management to the OS and simply state that you should install version X of library Y,īut not everyone is using ArchLinux or a similar Linux distribution which has the current version of everything as package. Now there is one situation where downloading a pre-compiled binary is enough: when using the package manager of your system.Īll the libraries are built with one compiler and one standard library under one system so they can all work together. If you want a pre-compiled binary it must have the exact same configuration as your system. You cannot use the same binary for different platforms, compilers, standard library implementations, build types (debug vs release), moon phases and a myriad of other factors. The Application Binary Interface, the way your interfaces are when compiled, is not standardized. seems way better but runs into a problem due to three letters - ABI.So often the package manager cache a binary once it is built - something we cannot do in this scope. ![]() has the disadvantage that some projects are huge and take really long to build.There are now two different approaches you can do - and all the package manager do one of those:ĭownload the sources and build the dependency. This is also true if you are deploying a binary only but need shared libraries.įurthermore, while some of the external dependencies are header-only, some aren’t and some take really long to build. So when installing the library you also need to take care the libraries are installed as well. Let’s say your are developing a C++ library that uses some external dependencies.Ī library is different from a “normal” program because clients need the external dependencies as well in order to work with the library. I’ve published a blog post about it here. Since writing this post, CMake has added FetchContent, a superior way to fetch dependencies than with submodules. This is the same system I’m currently using for standardese, my C++ documentation generator. It doesn’t require any external tools, works on all platforms and is relatively easy to setup and flexible for the user. This tutorial explains a relatively simple solution using CMake - the de-facto standard build tool - and git - the de-facto source code version control system. The following reddit comment describes it well: C++ dependency management is a more controversial topic with many alternatives and lots of third-party tools. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |