Working with Boost Header Files

Is there a way to dramatically reduce the number of header files needed to increase? Ideally, I ask Boost people to find a way to reduce their size. But at the same time, is there a way to enable boost but not have several thousand header files?

Is there a C ++ mechanism for “combining” thousands of header files into one “package” and just checking that one file is in the original control?

I guess the problem here is source control. Running diff, svn st, and check is so slow that all of these files are processed.

+6
source share
5 answers

Boost offers a tool called BCP . BCP allows you to retrieve subsets of boost. It can also analyze the source tree and extract only the Boost components that the source tree uses.

+9
source

I would recommend putting your third-party libraries in a separate repository. Boost is a heavy template, so there is a pretty good reason for them not to bind their headers. Trying to include nested formatting headers would move your "wasted" time to version control over build time. It really does not scale. I would refuse to use boost if you tried to do this for my boost headers.

You asked similar questions before, and I think I still don't know what technical limitations you are trying to get around.

+2
source

ccache can be a lifesaver to speed up heavy preprocessor compilations.

+1
source

It is impossible to pack everything in one file (except for archive versions, but this is not a very practical practice and practically in general). Subversion, on the other hand, is known to slowly track thousands of small files, such as forwards, so you might consider switching to a more powerful SCM, such as Git.

You will be interested in bcp , a Boost tool that analyzes your source and copies the Boost headers you use in a separate directory.This helped to significantly reduce third-party files, and basically it was correct in my case (I just had to add a few of them to list).

0
source

Not what you requested, but here is a way to fix your problem. As I understand it, you are adding Boost files to your code management repository. What for? They are not part of your project as such, they are not under your control.

This is how I structure my projects so that I do not encounter such a problem. Everything has been added to the source control, except for the include and lib folders, as described below. (I show only the relevant parts of my directory tree.)

  • /
    • src - includes my own source files and headers.
    • ext - external dependencies (e.g. boost)
      • boost-1-46-1
        • Download.txt - includes a link where you can download the correct version from
        • include - this is not added to the source control
        • lib is neither
0
source

Source: https://habr.com/ru/post/893610/


All Articles