blob: 86591473f5fe1feba0ba745a98bda8b6e4d98231 [file] [log] [blame]
William A. Kennington III9b171d92021-04-16 13:29:44 -07001project(
2 'stdplus',
3 'cpp',
4 version: '0.1',
William A. Kennington IIIb5d1c582021-04-16 13:41:39 -07005 meson_version: '>=0.57.0',
William A. Kennington III9b171d92021-04-16 13:29:44 -07006 default_options: [
7 'warning_level=3',
William A. Kennington IIIfd0f5512021-04-16 13:43:26 -07008 'cpp_std=c++20',
William A. Kennington III9b171d92021-04-16 13:29:44 -07009 'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'),
10 'examples=' + (meson.is_subproject() ? 'false' : 'true'),
11 ])
William A. Kennington III15982f62019-01-31 14:43:41 -080012
William A. Kennington III7613a5e2022-07-13 16:25:00 -070013has_dl = false
14if not get_option('dl').disabled()
15 dl_dep = meson.get_compiler('cpp').find_library('dl', required: false)
16 has_dl = meson.get_compiler('cpp').links('''
17 #include <dlfcn.h>
18 int main() { dlopen("", 0); }
19 ''', dependencies: dl_dep)
20endif
21if get_option('dl').enabled() and not has_dl
22 error('libdl support required')
23endif
24
25has_fd = false
26if not get_option('fd').disabled()
27 has_fd = true
28endif
29
30has_io_uring = false
31if not get_option('io_uring').disabled() and has_fd
32 io_uring_dep = dependency('liburing', required: get_option('io_uring'))
33 if io_uring_dep.found()
34 has_io_uring = true
35 endif
36endif
37if get_option('io_uring').enabled() and not has_io_uring
38 error('io_uring support is required')
39endif
40
41subdir('include')
William A. Kennington IIId7acddd2022-07-13 16:41:11 -070042if has_dl
43 subdir('include-dl')
44endif
45if has_fd
46 subdir('include-fd')
47endif
48if has_io_uring
49 subdir('include-uring')
50endif
51
William A. Kennington III15982f62019-01-31 14:43:41 -080052subdir('src')
53
54build_tests = get_option('tests')
55build_examples = get_option('examples')
56
57if build_examples
58 subdir('example')
59endif
60if not build_tests.disabled()
61 subdir('test')
62endif