This post summarizes the lessons learnt from adapting the CppMicroServices framework to a biicode compatible format. It does not go into detail about the actual modifications, but focuses on the lessons learnt adapting the framework.
CppMicroServices is an implementation of the OSGi framework, which enables runtime dependency injection. Modules of code (bundles) can be loaded and unloaded at runtime. In the case of CppMicroServices, bundles are either shipped in the form of shared libraries, or statically linked into the executable.
Based on packaging principles, bundles should be packaged and released separately – so that they can be depended on individually. biicode’s dependency management through blocks is suitable as a dependency management tool that supports this flow.
The problem: C and C++ compilation times
Biicode is a file-based dependencies manager for C and C++, focused on sharing and reusing source code, specifically, source (and header) files.
Biicode uses the CMake building system to configure and build blocks, its unit of source code sharing. The default way to develop blocks is to include the required sources and any required extra configuration for building such files on a
CMakeLists.txt file at the root of the block. Also biicode provides other files for specific config such as
So writting our own biicode block is a process with three simple steps:
- Get the sources and copy them on the block directory.
- Configure the
CMakeLists.txt file of the block for the specific build instructions for that sources.
- Upload the block to the biicode cloud via
bii publish command.
So far so good. This approach works pretty well and the biicode community is growing everyday thanks to it. Whats exactly the problem with this approach? Its simple: Some C and C++ sources are hard to compile and it takes time. A lot of time.