Fixes an issue when using pods in static library targets

Fixes #2666