Reputation: 2776
I have quite a large C++ project consisting of several shared libraries and executables. The project is built by SCons. My customers require that any patch must contain as few binary files as possible. In other words, I have to know before the build what targets are going to be built. Moreover, if A.cpp produces libB.sl which in turns affects libC.sl and D.bin I need to get only the libB.sl as the output. I cannot find a simple way to do that. Are there any recommendations?
Upvotes: 4
Views: 1106
Reputation: 1056
All the information you request in your question can be obtained before building, by parsing the output of the following command.
>> scons --dry-run --tree=all --debug=explain
This will not build anything (--dry-run
), will list all the files that need to be rebuilt and why (--debug=explain
), followed by the dependency tree (--tree=all
).
So you should be able to scrape from the output of this command the list of object files that need to be be re-built because of .cpp file code changes, and then parse the dependency tree to resolve which binaries you will have to include in your patch based on whatever rules you want to parse the dependency tree with.
Upvotes: 6