serial custom_commands?

We have a build that sometimes fails, because a executable for a custom command is already in use.
How can I make it run serial and never in parallel. Much like RUN_SERIAL for tests.

It sounds like the custom command needs to depend on the executable. That should serialize it with the executable’s link step (which is what I assume is being contended with here).