From f7b6431b6f02e9d479427dd2054cb97273e414e7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 May 2020 20:50:16 +0200 Subject: meson.build: work around Meson bug detecting strndup() on Windows Work around Meson bug https://github.com/mesonbuild/meson/issues/3672 --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 7c5dcac9f..ab28340a6 100644 --- a/meson.build +++ b/meson.build @@ -142,7 +142,13 @@ conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r')) conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r')) conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups')) conf.set('HAVE_FNMATCH', compiler.has_function('fnmatch')) -conf.set('HAVE_STRNDUP', compiler.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include ')) + +# Explicitly exclude Windows in this check because +# https://github.com/mesonbuild/meson/issues/3672 (reported in 2018, +# still not fixed in 2020) causes Meson to believe it exists, because +# __builtin_strndup() exists (but strndup() still cannot be used). +conf.set('HAVE_STRNDUP', not is_windows and compiler.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include ')) + conf.set('HAVE_STRCASESTR', compiler.has_function('strcasestr')) conf.set('HAVE_PRCTL', is_linux) -- cgit v1.2.3 From 5cb0080052856d988aa63922398f242ce6873a69 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 May 2020 15:36:49 +0200 Subject: meson.build: default to warning_level=2 This branch isn't yet ready for level 3 (`-Wpedantic`) due to several C++ violations (e.g. variable length arrays). These are already cleaned up in the master branch (0.22). --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index ab28340a6..fae9c488a 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,8 @@ project( meson_version: '>= 0.49.0', default_options: [ 'c_std=c99', - 'cpp_std=c++14' + 'cpp_std=c++14', + 'warning_level=2', ], license: 'GPLv2+', ) -- cgit v1.2.3