summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-05-27 16:16:30 +0200
committerMax Kellermann <max@musicpd.org>2020-05-27 16:16:30 +0200
commit5e93e882c989f7cbd64ecd6b4a60c5cd32d5f08c (patch)
treed6cf72921223d889aff079283f065b5f0cce7b3b /meson.build
parentc5f80dc543cdc0198a5bd853e29e1d42195fc526 (diff)
parent30d97fe8a040a9d89f3be2dd443c1991cc73405f (diff)
Merge branch 'v0.21.x'
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build11
1 files changed, 9 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 085b97bbc..ed1a36eb2 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++17'
+ 'cpp_std=c++17',
+ 'warning_level=2',
],
license: 'GPLv2+',
)
@@ -153,7 +154,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 <string.h>'))
+
+# 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 <string.h>'))
+
conf.set('HAVE_STRCASESTR', compiler.has_function('strcasestr'))
conf.set('HAVE_PRCTL', is_linux)