1

我一直在寻找一种方法或实用程序来查找大型 C/C++ 项目的依赖文件。

我想要的是,当文件被更改(提交)时,我希望我们的 buildbot 运行与更改的文件相关的类的测试。

任何帮助将不胜感激!

4

2 回答 2

1

Depends on which kind of buildbot you're using. The most common method I know is to use the C++ compilers' -M option to generate dependency makefiles you include to your main makefile. Tools like cmake would do this automatically for you without any efforts.

于 2012-05-28T18:46:09.683 回答
0

The compiler option

gcc -MMD

will output a list of dependencies used by the compiler, in a format suitable for use with GNU or Posix Make. Other compilers should have similar options, and it's not difficult to transform that dependency format for use with other make systems using e.g. perl.

于 2012-05-28T18:45:50.027 回答