开发者

How does one handle big library dependencies in source control?

My C++ application depends on Boost. I'd like someone t开发者_StackOverflow中文版o 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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜