add_dependencies: Allow calling with no dependencies

Fixes: #26713
8 files changed