Код: Выделить всё
ninja
ninja: error: build.ninja:6: expected 'command =' line
Код: Выделить всё
cxx = g++
cxxflags = -std=c++20 -Wall -Wextra
builddir = build
rule cxx
command = mkdir -p $builddir && $cxx $cxxflags -c $in -o $out
description = Compiling $in
rule link
command = $cxx $in -o $out
description = Linking $out
build $builddir/hello.o: cxx hello.cpp
build app: link $builddir/hello.o
default app
Код: Выделить всё
cat -A build.ninja
cxx = g++$
cxxflags = -std=c++20 -Wall -Wextra$
builddir = build$
$
rule cxx$
^Icommand = mkdir -p $builddir && $cxx $cxxflags -c $in -o $out$
^Idescription = Compiling $in$
$
rule link$
^Icommand = $cxx $in -o $out$
^Idescription = Linking $out$
$
build $builddir/hello.o: cxx hello.cpp$
build app: link $builddir/hello.o$
$
default app$
Подробнее здесь: https://stackoverflow.com/questions/792 ... rsing-file
Мобильная версия