Sharing C source code between various packages

My original (unanswered) stack overflow question is here:

I'm now realising that there's probably no way to include the C headers from another Swift package in the C code from a Swift package. I am wondering, however, if there's a way to set up a git dependency or something that would allow me to share Swift code between various packages? Is there any pointers into ways I could achieve this? I'd very much rather not have to duplicate C code across my packages.

Thank you!

I figured out a hackish solution, and posted the answer on Stack Overflow as well. Posting here in case anyone needs it.