Ninja Build 期间的 Sudo

Sudo during Ninja Build

我有一个使用 cmake + make 构建的项目,它使用宏来更改应用程序文件的功能。

我正在尝试从 make 切换到 ninja,但是当 sudo 需要询问我 root 密码以便 运行 setcap ninja 没有显示请求并且不允许我插入它。

是否可以对此做些什么?

PS。将 setcap 执行移出构建时间不是一个选项,因为其他人正在使用 make,他们很高兴这样!

执行sudo的目标应该在控制台池中

There exists a pre-defined pool named console with a depth of 1. It has the special property that any task in the pool has direct access to the standard input, output and error streams provided to Ninja, which are normally connected to the user’s console (hence the name) but could be redirected. This can be useful for interactive tasks or long-running tasks which produce status updates on the console (such as test suites).

Docs