build: Refactor directory structure to separate headers
This makes the structure similar to other OpenBMC projects.
Change-Id: I5b76fe7439dba9b68244ee1494f2266b6351e498
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meson.build b/meson.build
index 8e09a59..7d7e0c8 100644
--- a/meson.build
+++ b/meson.build
@@ -10,6 +10,35 @@
'examples=' + (meson.is_subproject() ? 'false' : 'true'),
])
+has_dl = false
+if not get_option('dl').disabled()
+ dl_dep = meson.get_compiler('cpp').find_library('dl', required: false)
+ has_dl = meson.get_compiler('cpp').links('''
+ #include <dlfcn.h>
+ int main() { dlopen("", 0); }
+ ''', dependencies: dl_dep)
+endif
+if get_option('dl').enabled() and not has_dl
+ error('libdl support required')
+endif
+
+has_fd = false
+if not get_option('fd').disabled()
+ has_fd = true
+endif
+
+has_io_uring = false
+if not get_option('io_uring').disabled() and has_fd
+ io_uring_dep = dependency('liburing', required: get_option('io_uring'))
+ if io_uring_dep.found()
+ has_io_uring = true
+ endif
+endif
+if get_option('io_uring').enabled() and not has_io_uring
+ error('io_uring support is required')
+endif
+
+subdir('include')
subdir('src')
build_tests = get_option('tests')