conf.set('SYSCONFDIR', '"@0@"'.format(sysconfdir))
-# Check for json-c availability
-json_c_dep = dependency('json-c',
- version: '>=0.13',
- required: true,
- fallback : ['json-c', 'json_c_dep'])
+if get_option('json-c').disabled()
+ json_c_dep = dependency('', required: false)
+else
+ json_c_dep = dependency('json-c',
+ version: '>=0.13',
+ required: true,
+ fallback : ['json-c', 'json_c_dep'])
+endif
conf.set('CONFIG_JSONC', json_c_dep.found(), description: 'Is json-c required?')
# Check for OpenSSL availability
option('python', type : 'combo', choices : ['auto', 'true', 'false'], description : 'Generate libnvme python bindings')
option('openssl', type : 'feature', value: 'auto', description : 'OpenSSL support')
option('libdbus', type : 'feature', value: 'auto', description : 'libdbus support')
+option('json-c', type : 'feature', value: 'auto', description : 'JSON support')
'nvme/mi-mctp.c',
]
-if conf.get('CONFIG_JSONC')
+if json_c_dep.found()
sources += 'nvme/json.c'
+else
+ sources += 'nvme/no-json.c'
endif
deps = [
--- /dev/null
+// SPDX-License-Identifier: LGPL-2.1-or-later
+/*
+ * This file is part of libnvme.
+ * Copyright (c) 2023 SUSE Software Solutions
+ *
+ * Authors: Daniel Wagner <dwagner@suse.de>
+ */
+
+#include "tree.h"
+
+#include <errno.h>
+
+int json_read_config(nvme_root_t r, const char *config_file)
+{
+ return -ENOTSUP;
+}
+
+int json_update_config(nvme_root_t r, const char *config_file)
+{
+ return -ENOTSUP;
+}
+
+int json_dump_tree(nvme_root_t r)
+{
+ return -ENOTSUP;
+}