Autogen: Fix library dependency forwarding to _autogen target
Library dependencies of the origin target were forwarded to the _autogen target as source file dependencies. This is fixed by forwarding the dependencies as target dependencies instead.
This is the 3.11/master branch fix for #17278 (closed)