summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:17:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:17:17 +0000
commit0e75b5495117b9888b7a557fab1db40145a9a705 (patch)
treee294b5156b7a85197e4b3192b6fba291a26dd5c6 /meson.build
parentAdding upstream version 1.1. (diff)
downloadlibnvme-0e75b5495117b9888b7a557fab1db40145a9a705.tar.xz
libnvme-0e75b5495117b9888b7a557fab1db40145a9a705.zip
Adding upstream version 1.2.upstream/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())