英文:
Is there a way to use environment variables with Ninja?
问题
我有以下的 Ninja 文件,因为我找不到一种将环境变量传递给 Ninja 步骤的方法:
rule init
command = sh init.sh
rule plan
command = sh plan.sh
rule apply
command = sh apply.sh
build plan: plan
build init: init
build apply: apply
default plan
我想要跳过使用 shell 脚本并在 Ninja 中捕获所有步骤。我不确定这是否完全支持。
英文:
I have the following ninja file because I could not find a way to pass environment variables to ninja steps:
rule init
command = sh init.sh
rule plan
command = sh plan.sh
rule apply
command = sh apply.sh
build plan: plan
build init: init
build apply: apply
default plan
I would like to skip using shell scripts and capture all the steps in Ninja. I am not sure if this is supported at all.
答案1
得分: 0
这是Ninja的设计决策,不执行该操作。如果您需要向Ninja传递任何参数,支持的方式是使用构建生成器生成构建文件。
英文:
It is a design decision of Ninja not to do that. If you need to pass in any parameter to Ninja the supported way to generate the build file with a build generator.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论