GENie
GENie copied to clipboard
Error: custombuildtask multiple command calls not allowed in Ninja
custombuildtask {
{
_input_file,
_output_file,
{},
{
"C:/workcopy/extsw/windows_amd64/qt3/bin/moc.exe $(<) ".._defines_params.." -o $(@)",
"echo Running MOC on",
},
},
}
When I try to compile this with a second command (echo) and error occurs. I tried if there is a MOC error, but if I use 2 echo commands the error output are the same, I dont know if is a Ninja or not....
ninja: error: ASDF.ninja:40: multiple rules generate ../../_input_file.cpp [-w dupbuild=err]
See: https://milostosic.github.io/build/
It's set of GENie build scripts, that supports Qt too.
mmm really interested, I will take a look at this auto project setup, but independently of this autogen with QT support, Does Ninja supports double command in a same file? I checked that VS can but with Ninja I´m not sure. Thanks for the info, I didnt know the existence of a powerfull magic that uses GENIe
mame appears to be affected too (you have to fix some $ escaping errors first):
custombuildtask {
{ MAME_DIR .. "scripts/font/NotoSans-Bold.bdc", GEN_DIR .. "emu/uismall.fh", { MAME_DIR .. "scripts/build/file2str.py" }, { "@echo Converting NotoSans-Bold.bdc...", PYTHON .. " $(1) $(<) $(@) font_uismall uint8_t" } },
}
custombuildtask {
{ MAME_DIR .. "src/frontend/mame/ui/uicmd14.png", GEN_DIR .. "emu/ui/uicmd14.fh", { MAME_DIR.. "scripts/build/png2bdc.py", MAME_DIR .. "scripts/build/file2str.py" }, { "@echo Converting uicmd14.png...", PYTHON .. " $(1) $(<) temp_cmd.bdc", PYTHON .. " $(2) temp_cmd.bdc $(@) font_uicmd14 uint8_t" } },
Per this:
Internally, ninja just ignores all but the last rule.
Per the ninja manual on rules
and commands
:
Each
rule
may have only onecommand
declaration. See the next section for more details on quoting and executing multiple commands.
...
On Unixes, commands are arrays of arguments. The Ninja
command
variable is passed directly tosh -c
, which is then responsible for interpreting that string into an argv array. Therefore the quoting rules are those of the shell, and you can use all the normal shell operators, like&&
to chain multiple commands, orVAR=value cmd
to set environment variables.