For "why does static_library help": A source_set always has all its files linked in to executables that depend on it. A static library only has the files inside it linked in to executables that depend on it that are referenced from other files.
As an example: If you have:
* a target t1 with files file1.cc and file2.cc
* file1.cc contains symbol symbol1()
* file2.cc contains symbol symbol2()
…and you link that target into an executable that has
* a call to symbol1()
* but nothing calls symbol2()
…then:
* if t1 is a source_set, both file1.o and file2.o will be linked into the executable
* but if t1 is a static_library(), only file1.o will be linked into the executable
If file2.o contains references to undefined symbols, you'll end up with linker errors in the first case, but not in the second.