William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 1 | fmt_dep = dependency('fmt', required: false) |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 2 | if not fmt_dep.found() |
William A. Kennington III | b5d1c58 | 2021-04-16 13:41:39 -0700 | [diff] [blame] | 3 | fmt_opts = import('cmake').subproject_options() |
| 4 | fmt_opts.add_cmake_defines({ |
| 5 | 'CMAKE_POSITION_INDEPENDENT_CODE': 'ON', |
| 6 | 'MASTER_PROJECT': 'OFF', |
| 7 | }) |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 8 | fmt_proj = import('cmake').subproject( |
| 9 | 'fmt', |
William A. Kennington III | b5d1c58 | 2021-04-16 13:41:39 -0700 | [diff] [blame] | 10 | options: fmt_opts, |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 11 | required: false) |
| 12 | assert(fmt_proj.found(), 'fmtlib is required') |
| 13 | fmt_dep = fmt_proj.dependency('fmt') |
| 14 | endif |
| 15 | |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 16 | stdplus_deps = [ |
| 17 | fmt_dep, |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 18 | ] |
| 19 | |
William A. Kennington III | 4575424 | 2021-04-28 12:48:31 -0700 | [diff] [blame] | 20 | stdplus_srcs = [ |
William A. Kennington III | 7613a5e | 2022-07-13 16:25:00 -0700 | [diff] [blame^] | 21 | 'exception.cpp', |
| 22 | 'signal.cpp', |
William A. Kennington III | 4575424 | 2021-04-28 12:48:31 -0700 | [diff] [blame] | 23 | ] |
| 24 | |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 25 | if has_dl |
| 26 | stdplus_deps += [ |
| 27 | dl_dep, |
| 28 | ] |
| 29 | |
| 30 | stdplus_srcs += [ |
William A. Kennington III | 7613a5e | 2022-07-13 16:25:00 -0700 | [diff] [blame^] | 31 | 'dl.cpp', |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 32 | ] |
William A. Kennington III | 5a52802 | 2021-04-28 12:52:43 -0700 | [diff] [blame] | 33 | endif |
| 34 | |
William A. Kennington III | 7613a5e | 2022-07-13 16:25:00 -0700 | [diff] [blame^] | 35 | if has_fd |
William A. Kennington III | 4575424 | 2021-04-28 12:48:31 -0700 | [diff] [blame] | 36 | stdplus_srcs += [ |
William A. Kennington III | 7613a5e | 2022-07-13 16:25:00 -0700 | [diff] [blame^] | 37 | 'fd/create.cpp', |
| 38 | 'fd/dupable.cpp', |
| 39 | 'fd/impl.cpp', |
| 40 | 'fd/managed.cpp', |
| 41 | 'fd/mmap.cpp', |
| 42 | 'fd/ops.cpp', |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 43 | ] |
William A. Kennington III | eac9d47 | 2020-08-03 13:57:14 -0700 | [diff] [blame] | 44 | endif |
| 45 | |
William A. Kennington III | 7613a5e | 2022-07-13 16:25:00 -0700 | [diff] [blame^] | 46 | if has_io_uring |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 47 | stdplus_deps += [ |
| 48 | io_uring_dep, |
| 49 | ] |
| 50 | |
| 51 | stdplus_srcs += [ |
William A. Kennington III | 7613a5e | 2022-07-13 16:25:00 -0700 | [diff] [blame^] | 52 | 'io_uring.cpp', |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 53 | ] |
William A. Kennington III | 5c20da2 | 2021-06-18 16:44:55 -0700 | [diff] [blame] | 54 | endif |
| 55 | |
William A. Kennington III | 97e3947 | 2019-04-03 13:22:32 -0700 | [diff] [blame] | 56 | stdplus_lib = library( |
William A. Kennington III | 15982f6 | 2019-01-31 14:43:41 -0800 | [diff] [blame] | 57 | 'stdplus', |
William A. Kennington III | 4575424 | 2021-04-28 12:48:31 -0700 | [diff] [blame] | 58 | stdplus_srcs, |
William A. Kennington III | 97e3947 | 2019-04-03 13:22:32 -0700 | [diff] [blame] | 59 | include_directories: stdplus_headers, |
William A. Kennington III | 15982f6 | 2019-01-31 14:43:41 -0800 | [diff] [blame] | 60 | implicit_include_directories: false, |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 61 | dependencies: stdplus_deps, |
William A. Kennington III | 1937ef6 | 2019-03-28 03:24:57 -0700 | [diff] [blame] | 62 | version: meson.project_version(), |
William A. Kennington III | 15982f6 | 2019-01-31 14:43:41 -0800 | [diff] [blame] | 63 | install: true) |
| 64 | |
William A. Kennington III | 3acf92b | 2021-04-16 13:33:50 -0700 | [diff] [blame] | 65 | stdplus_dep = declare_dependency( |
William A. Kennington III | e099038 | 2019-10-18 02:10:25 -0700 | [diff] [blame] | 66 | dependencies: stdplus_deps, |
William A. Kennington III | 97e3947 | 2019-04-03 13:22:32 -0700 | [diff] [blame] | 67 | include_directories: stdplus_headers, |
| 68 | link_with: stdplus_lib) |
| 69 | |
William A. Kennington III | b01c557 | 2020-06-03 19:40:49 -0700 | [diff] [blame] | 70 | stdplus_reqs = [] |
| 71 | foreach dep : stdplus_deps |
| 72 | if dep.type_name() == 'pkgconfig' |
William A. Kennington III | 285fbcb | 2021-01-24 18:16:20 -0800 | [diff] [blame] | 73 | stdplus_reqs += dep |
William A. Kennington III | b01c557 | 2020-06-03 19:40:49 -0700 | [diff] [blame] | 74 | endif |
| 75 | endforeach |
| 76 | |
William A. Kennington III | 15982f6 | 2019-01-31 14:43:41 -0800 | [diff] [blame] | 77 | import('pkgconfig').generate( |
William A. Kennington III | 285fbcb | 2021-01-24 18:16:20 -0800 | [diff] [blame] | 78 | stdplus_lib, |
William A. Kennington III | 15982f6 | 2019-01-31 14:43:41 -0800 | [diff] [blame] | 79 | description: 'C++ helper utilities', |
| 80 | version: meson.project_version(), |
William A. Kennington III | b01c557 | 2020-06-03 19:40:49 -0700 | [diff] [blame] | 81 | requires: stdplus_reqs) |