[Scons-users] Linking a subset of common object files

Ale Strooisma a.strooisma at student.utwente.nl
Thu Apr 28 03:53:25 EDT 2016


Hi all,

My project creates quite a few programs from a large set of source files.
Currently each program gets linked with all of the common source files,
though each program requires only a subset of the source files. This has
the downside of way too long link times and way too large binaries. I don't
manually specify which specific files need to be linked because:
a) I'd have to type enormously long lists,
b) every time a new file is added, the build breaks and I have to manually
change the lists,
c) when a dependency is removed I am bound to forget to remove it from the
lists.

This makes me think: this is precisely the kind of problem I use a smart
build system for! Now I realize that figuring out the dependencies for
linking is non-trivial. I noticed however that for each object file that
needs to be linked, the main source file depends (directly or indirectly)
on the a header file with the same name, save for the extension. And a
dependency tree for those header files exists. Is there a way to use this?

Or should I just compile all of the common source files into a shared
library?

Kind regards,
Ale Strooisma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160428/3809ecf8/attachment.html>


More information about the Scons-users mailing list