Xcode: Process targets in depth-first order during generation
The Xcode 10 "new build system" requires more strict handling of custom commands. It may need a fix similar to what !1889 (merged) did for VS. Prepare for this by generating targets within each local generator in dependency order.
Issue: #18070