介子有构建命令吗?

Is there a build command for meson?

好吧,我可以初始化并构建一个介子,项目为:

$ cd /tmp/
$ mkdir foobar; cd foobar
$ meson init --name foobar -l cpp --build
Using "foobar" (project name) as name of executable to build.
Sample project created. To build it run the
following commands:

meson builddir
ninja -C builddir

Building...
The Meson build system
Version: 0.53.2
Source dir: /tmp/foobar
Build dir: /tmp/foobar/build
Build type: native build
Project name: foobar
Project version: 0.1
C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

Found ninja-1.10.0 at /usr/bin/ninja
ninja: Entering directory `build'                                                                   
[2/2] Linking target foobar.

但是对于创建的项目,我已经阅读了手册页和网站,但我可以找到诸如 $ meson build.

之类的命令

是的,我知道有:

$ cd build
$ ninja

但我认为 init 命令中有 --build...它是其他用于构建的吗?

配置构建后,您可以执行以下操作:

cd build
meson compile

meson compile -C build

查看文档@:https://mesonbuild.com/Running-Meson.html#building-from-the-source