summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:17:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:17:32 +0000
commitb0dc2feab3271dbcb42df6e6d8a37138a90c44a1 (patch)
treeae02f159c125f183b2adae47fdf0e64357bf76a8 /meson.build
parentReleasing debian version 1.1-2. (diff)
downloadlibnvme-b0dc2feab3271dbcb42df6e6d8a37138a90c44a1.tar.xz
libnvme-b0dc2feab3271dbcb42df6e6d8a37138a90c44a1.zip
Merging upstream version 1.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build34
1 files changed, 27 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index bd13fe9..5c2e73a 100644
--- a/meson.build
+++ b/meson.build
@@ -7,8 +7,8 @@
#
project(
'libnvme', ['c'],
- meson_version: '>= 0.47.0',
- version: '1.1',
+ meson_version: '>= 0.48.0',
+ version: '1.2',
license: 'LGPL-2.1-or-later',
default_options: [
'c_std=gnu99',
@@ -18,7 +18,8 @@ project(
]
)
-library_version = meson.project_version() + '.0'
+maj_min = meson.project_version().split('-rc')[0]
+library_version = maj_min + '.0'
################################################################################
cc = meson.get_compiler('c')
@@ -51,10 +52,6 @@ conf.set('PROJECT_VERSION', '"@0@"'.format(meson.project_version()))
conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
-# Check for libuuid availability
-libuuid_dep = dependency('uuid', required: true, fallback : ['uuid', 'uuid_dep'])
-conf.set('CONFIG_LIBUUID', libuuid_dep.found(), description: 'Is libuuid required?')
-
# Check for json-c availability
json_c_dep = dependency('json-c',
version: '>=0.13',
@@ -185,6 +182,29 @@ conf.set10(
description: 'Is linux/mctp.h include-able?'
)
+if meson.version().version_compare('>= 0.48')
+ has_fallthrough = cc.has_function_attribute('fallthrough')
+else
+ has_fallthrough = cc.compiles(
+ '''int main(int argc, char **argv) {
+ switch(argc) {
+ case 0:
+ __attribute__((__fallthrough__));
+ case 1:
+ return 1;
+ }
+ return 0;
+ }
+ ''',
+ name: 'has fallthrough')
+endif
+
+if has_fallthrough
+ conf.set('fallthrough', '__attribute__((__fallthrough__))')
+else
+ conf.set('fallthrough', 'do {} while (0) /* fallthrough */')
+endif
+
################################################################################
substs = configuration_data()
substs.set('NAME', meson.project_name())