8

So I'm using a set of boost libraries, but the sheer number of include files makes checking out a clean copy really slow. I'm sure most people who are using boost with svn have noticed this. I googled around for a little while to find a nice utility from boost called bcp that will copy only the dependent header files to a directory that I specify. So, what I'd like to do is provide a minimal number of header files in svn and allow the developer to compile everything as necessary. The first step would be to copy the necessary header files and checkin all the necessary precompiled libs. The next step would be to throw away the pre-compiled libs and make it a pre-build step in whatever build system I'm using for my project (in my case Visual Studio, but make would be perfectly fine too). My question is this

Does anybody know how to build only the libs necessary for a subset of headers?

I'm doing a bcp along the lines of this

bcp.exe --scan C:\path\to\my\files\main.cpp C:\path\to\my\files\someOtherCppFilesToo.cpp C:\path\to\reduced\boost

The internet seems to think I can do something like this

cd C:\path\to\reduced\boost
bootstrap.exe
b2.exe

Now the problem is that I can't figure out if there's some way to copy over the compile/bootstrap/jam/whatever configuration so that boost.build and bootstrap know how to configure/compile everything. I obviously don't want to copy every file from the boost directory, because that would defeat the whole purpose of reducing the boost includes.

Siguza
  • 21,155
  • 6
  • 52
  • 89
xaviersjs
  • 1,579
  • 1
  • 15
  • 25
  • Similar post http://stackoverflow.com/questions/3626625/getting-a-buildable-boost-extract-with-bcp – CAMOBAP Nov 17 '15 at 12:40

1 Answers1

3

Well, I believe you were close to it:

bcp.exe --scan --boost=path_to_boost_dir main.cpp someOtherCppFilesToo.cpp myboost
bcp.exe --boost=path_to_boost_dir build myboost
cd myboost
bootstrap.bat
b2 the_modules_you_want_to_build
Heyji
  • 1,113
  • 8
  • 26
  • 3
    I was getting an error during `./b2` when inside `myboost/`: could not find `predef.jam`. To solve it used `bcp` on `predef` (like the answer does to `build`). – Daniel Apr 17 '18 at 15:12