Search code examples
c++boost

How to export only a subset of header-only boost libraries?


From the boost library, I only require circular_buffer for an android project (maybe some other later, but it will always be header-only). Thus, I would like to create a distribution containing only the required files.

I tried using the official distribution, and executing :

./bootstrap.sh --includedir=.. --with-libraries=circular_buffer

However, when I then execute :

./b2

It outputs :

error: wrong library name 'circular_buffer' in the --with-<library> option.

What am I doing wrong ?


Solution

  • Bootstrap and b2 are only required for building library binaries. As you said, you will use header-only only, so that's not required.

    You can just zip up the boost/ include folders and be happy.

    In theory you can prune the set of includes with BCP: https://www.boost.org/doc/libs/1_75_0/tools/bcp/doc/html/index.html

    However, in practice I doubt it's worth the effort.