Fix passing multiple switches as a single word to the build

Fixes #17434.