FIX: Multiple links being generated for non-theme targets. (PR #13457)

Follow-up to 8e3691d5370bb95d99fe750f46287763721fcc9c

GitHub