summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to '')
-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())