These are only needed for building the actual project and not for managing resources or setting various flags. Gets rid of the double `source-only` check and moves it closer to the consumer (cherry picked from commit 64420f4366a290b3c3f48f0131a8f77312def595)