build: use gnu99 globally instead of per-project

This commit is contained in:
Riccardo Schirone 2022-07-04 10:59:24 +02:00 committed by Anton Kochkov
parent adfaa180e6
commit 98acbb041a
5 changed files with 3 additions and 20 deletions

View file

@ -140,9 +140,9 @@ if is_static_build
endif
if cc.has_argument('--std=gnu99')
add_project_arguments('--std=gnu99', language: ['c', 'cpp'])
add_global_arguments('--std=gnu99', language: ['c', 'cpp'])
elif cc.has_argument('--std=c99')
add_project_arguments('--std=c99', language: ['c', 'cpp'])
add_global_arguments('--std=c99', language: ['c', 'cpp'])
endif
# Sanitize correct usage of rz_strf()

View file

@ -1,5 +1,4 @@
project('libzip', 'c',
default_options : ['c_std=c99', 'buildtype=release'],
version: '1.7.3')
py3_exe = import('python').find_installation()

View file

@ -1,6 +1,5 @@
project('lz4', ['c'],
license: ['BSD', 'GPLv2'],
default_options : ['c_std=c99', 'buildtype=release'],
version: '1.9.3',
meson_version: '>=0.47.0')

View file

@ -2,13 +2,6 @@ project('tree-sitter', 'c')
cc = meson.get_compiler('c')
tree_sitter_cflags = ''
if cc.has_argument('-std=gnu99')
tree_sitter_cflags = '-std=gnu99'
elif cc.has_argument('-std=c99')
tree_sitter_cflags = '-std=c99'
endif
tree_sitter_path = 'tree-sitter'
tree_sitter_files = ['lib/src/lib.c']
@ -18,12 +11,10 @@ tree_sitter_inc = [include_directories('lib/src'), include_directories('lib/incl
libtree_sitter = static_library('tree_sitter', tree_sitter_files,
include_directories: tree_sitter_inc,
implicit_include_directories: false,
c_args: tree_sitter_cflags,
install: not meson.is_subproject()
)
tree_sitter_dep = declare_dependency(
compile_args: tree_sitter_cflags,
link_with: libtree_sitter,
include_directories: tree_sitter_inc
)
)

View file

@ -1,17 +1,11 @@
# liblzma is what upstream uses for their pkg-config name
project('liblzma', 'c',
default_options : ['c_std=c99', 'buildtype=release'],
version : '5.2.5',
license : 'pd/lgpl2/gpl2/gpl3',)
cc = meson.get_compiler('c')
lzma_cflags = ['-DHAVE_CONFIG_H', '-DTUKLIB_SYMBOL_PREFIX=lzma_', '-DLZMA_API_STATIC']
if cc.has_argument('-std=gnu99')
lzma_cflags += ['-std=gnu99']
elif cc.has_argument('-std=c99')
lzma_cflags += ['-std=c99']
endif
cdata = configuration_data()