问题
My C++ application depends on Boost. I'd like someone to just be able to check out my repository and build the whole thing in one step. But the boost distribution is some 100MB and thousands of files, and it seems to bog down source control -- plus I really don't need it to be versioned.
What's the best way to handle this kind of problem?
回答1:
Most version control tools/systems provide mechanics to add references to other repositories into your repository.
This way you can keep your repository clean from files of other repositories but still be able to just point to the correct library and version.
In Git it’s called submodules. In SVN it’s called externals.
In the end you’ll have to decide on whether you want to include the files into your repo so others won’t have to checkout the other repos as well, even when the references (submodule/external) make just that pretty easy. I’d prefer a clean repo though and reference other repositories, if available. This will also make maintaining and upgrading those libraries a lot easier.
回答2:
I've found the book "Large-Scale C++ Software Design" by John Lakos very useful as far as organising large C++ projects is concerned. Recommended.
来源:https://stackoverflow.com/questions/4475968/how-does-one-handle-big-library-dependencies-in-source-control