Ninja: Fix build event commands with $-sign on custom targets

Fixes: #26143
2 files changed