介子不产生任何二进制文件

meson not producing any binary files

我有一个使用介子的 C 项目。

介子文件如下所示:

project('camtool', 'c', version : '0.0.1',default_options : ['c_std=c11'])
cxx = meson.get_compiler('c')
systemd_dep = cxx.find_library('systemd')
pthread_dep = cxx.find_library('pthread')



inc = include_directories('include')

subdir('include')
subdir('src')

executable('camtool', './src/test.c',
                     include_directories : inc,
                     dependencies : [systemd_dep,pthread_dep])

我的 src/test.c 看起来像这样:

#include <stdio.h>
int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!")
   return 0;
}

介子构建的输出是:

DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
Using 'PKG_CONFIG_PATH' from environment with value: '/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/lib/pkgconfig:/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/share/pkgconfig'
The Meson build system
Version: 0.56.0
Source dir: /workspaces/quark-v4l2
Build dir: /workspaces/quark-v4l2/build
Build type: cross build
Project name: camtool
Project version: 0.0.1
Using 'CFLAGS' from environment with value: ' -O2 -pipe -g -feliminate-unused-debug-types '
Using 'LDFLAGS' from environment with value: '-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: ''
C compiler for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux (gcc 9.3.0 "x86_64-poky-linux-gcc (GCC) 9.3.0")
C linker for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux ld.bfd 2.34.0.20200220
C compiler for the build machine: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
C linker for the build machine: cc ld.bfd 2.31.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Library systemd found: YES
Library pthread found: YES
Build targets in project: 1

Found ninja-1.10.0 at /opt/poky/3.1.6/sysroots/x86_64-pokysdk-linux/usr/bin/ninja

在我 运行 介子构建之后,我 运行 find . | grep camtool 但它没有找到二进制文件。
我在哪里可以找到介子产生的二进制文件?

好的,我发现原因是我误解了介子中的一些步骤。

Meson 构建似乎是生成构建文件夹的构建设置,但实际上并没有构建任何东西。

为了构建它,我必须从构建目录中 运行 ninja。 运行 ninja 给了我一个错误,因为我的 test.c 缺少一个分号。

添加分号并重新运行ning ninja 后,生成了二进制文件