如何使用介子构建c程序项目



我想用介子构建一个c项目。请提供以介子表示的内容构建文件和在哪里放置它?

这些是项目文件夹

Project_dir/
src/
command.c
include/
command.h
main.c
Project_dir/
src/
command.c
include/
command.h
main.c
meson.build

then in meson.build

project(
'dummy', 'c',
version : '1.1.0',
default_options : ['buildtype=debugoptimized','warning_level=1'],
)

#define default build args for all c
build_args_c = ['-Wall',]
#source cofe
project_source_files = ['src/command.c','main.c',]  
#include folder
proj_headers = include_directories('include')

executable(
meson.project_name(),
project_source_files,
#dependencies:   [''],
c_args : build_args_c,
gnu_symbol_visibility : 'default',
include_directories :  [proj_headers]
)

then setup meson proj

meson setup dummyProj

然后编译

meson compile -C dummyProj

相关内容

最新更新