Attach sources when building.

Closes #1409.