blob: 7d7e0c800dcdb4e58937e28e4fe4deac7e25ba74 [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 III15982f62019-01-31 14:43:41 -080042subdir('src')
43
44build_tests = get_option('tests')
45build_examples = get_option('examples')
46
47if build_examples
48 subdir('example')
49endif
50if not build_tests.disabled()
51 subdir('test')
52endif