Fix compilation issues when building as target dependency