From 98acbb041a64f8c0dbe867aa8bca742e586498cd Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Mon, 4 Jul 2022 10:59:24 +0200 Subject: [PATCH] build: use gnu99 globally instead of per-project --- meson.build | 4 ++-- subprojects/packagefiles/libzip-1.7.3/meson.build | 1 - subprojects/packagefiles/lz4-1.9.3/meson.build | 1 - .../packagefiles/tree-sitter-0.20.6/meson.build | 11 +---------- subprojects/packagefiles/xz-5.2.5/meson.build | 6 ------ 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/meson.build b/meson.build index c6d6c15c6d..140c12205c 100644 --- a/meson.build +++ b/meson.build @@ -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() diff --git a/subprojects/packagefiles/libzip-1.7.3/meson.build b/subprojects/packagefiles/libzip-1.7.3/meson.build index 64e7d48bfe..0bdc8afad9 100644 --- a/subprojects/packagefiles/libzip-1.7.3/meson.build +++ b/subprojects/packagefiles/libzip-1.7.3/meson.build @@ -1,5 +1,4 @@ project('libzip', 'c', - default_options : ['c_std=c99', 'buildtype=release'], version: '1.7.3') py3_exe = import('python').find_installation() diff --git a/subprojects/packagefiles/lz4-1.9.3/meson.build b/subprojects/packagefiles/lz4-1.9.3/meson.build index 91ade1aab0..88fcfa5bc5 100644 --- a/subprojects/packagefiles/lz4-1.9.3/meson.build +++ b/subprojects/packagefiles/lz4-1.9.3/meson.build @@ -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') diff --git a/subprojects/packagefiles/tree-sitter-0.20.6/meson.build b/subprojects/packagefiles/tree-sitter-0.20.6/meson.build index 47593313fc..8b4af7e5d2 100644 --- a/subprojects/packagefiles/tree-sitter-0.20.6/meson.build +++ b/subprojects/packagefiles/tree-sitter-0.20.6/meson.build @@ -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 -) \ No newline at end of file +) diff --git a/subprojects/packagefiles/xz-5.2.5/meson.build b/subprojects/packagefiles/xz-5.2.5/meson.build index 1750ff8b93..1652f13f46 100644 --- a/subprojects/packagefiles/xz-5.2.5/meson.build +++ b/subprojects/packagefiles/xz-5.2.5/meson.build @@ -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()