blob: 1492655db517c4b50adab1571ffa84ebb13e21f7 [file] [log] [blame]
William A. Kennington IIIe0990382019-10-18 02:10:25 -07001fmt_dep = dependency('fmt', required: false)
William A. Kennington IIIe0990382019-10-18 02:10:25 -07002if not fmt_dep.found()
William A. Kennington IIIb5d1c582021-04-16 13:41:39 -07003 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 IIIe0990382019-10-18 02:10:25 -07008 fmt_proj = import('cmake').subproject(
9 'fmt',
William A. Kennington IIIb5d1c582021-04-16 13:41:39 -070010 options: fmt_opts,
William A. Kennington IIIe0990382019-10-18 02:10:25 -070011 required: false)
12 assert(fmt_proj.found(), 'fmtlib is required')
13 fmt_dep = fmt_proj.dependency('fmt')
14endif
15
William A. Kennington IIIe0990382019-10-18 02:10:25 -070016stdplus_deps = [
17 fmt_dep,
William A. Kennington IIIe0990382019-10-18 02:10:25 -070018]
19
William A. Kennington III45754242021-04-28 12:48:31 -070020stdplus_srcs = [
William A. Kennington III7613a5e2022-07-13 16:25:00 -070021 'exception.cpp',
22 'signal.cpp',
William A. Kennington III45754242021-04-28 12:48:31 -070023]
24
William A. Kennington III5a528022021-04-28 12:52:43 -070025if has_dl
26 stdplus_deps += [
27 dl_dep,
28 ]
29
30 stdplus_srcs += [
William A. Kennington III7613a5e2022-07-13 16:25:00 -070031 'dl.cpp',
William A. Kennington III5a528022021-04-28 12:52:43 -070032 ]
William A. Kennington III5a528022021-04-28 12:52:43 -070033endif
34
William A. Kennington III7613a5e2022-07-13 16:25:00 -070035if has_fd
William A. Kennington III45754242021-04-28 12:48:31 -070036 stdplus_srcs += [
William A. Kennington III7613a5e2022-07-13 16:25:00 -070037 '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 IIIeac9d472020-08-03 13:57:14 -070043 ]
William A. Kennington IIIeac9d472020-08-03 13:57:14 -070044endif
45
William A. Kennington III7613a5e2022-07-13 16:25:00 -070046if has_io_uring
William A. Kennington III5c20da22021-06-18 16:44:55 -070047 stdplus_deps += [
48 io_uring_dep,
49 ]
50
51 stdplus_srcs += [
William A. Kennington III7613a5e2022-07-13 16:25:00 -070052 'io_uring.cpp',
William A. Kennington III5c20da22021-06-18 16:44:55 -070053 ]
William A. Kennington III5c20da22021-06-18 16:44:55 -070054endif
55
William A. Kennington III97e39472019-04-03 13:22:32 -070056stdplus_lib = library(
William A. Kennington III15982f62019-01-31 14:43:41 -080057 'stdplus',
William A. Kennington III45754242021-04-28 12:48:31 -070058 stdplus_srcs,
William A. Kennington III97e39472019-04-03 13:22:32 -070059 include_directories: stdplus_headers,
William A. Kennington III15982f62019-01-31 14:43:41 -080060 implicit_include_directories: false,
William A. Kennington IIIe0990382019-10-18 02:10:25 -070061 dependencies: stdplus_deps,
William A. Kennington III1937ef62019-03-28 03:24:57 -070062 version: meson.project_version(),
William A. Kennington III15982f62019-01-31 14:43:41 -080063 install: true)
64
William A. Kennington III3acf92b2021-04-16 13:33:50 -070065stdplus_dep = declare_dependency(
William A. Kennington IIIe0990382019-10-18 02:10:25 -070066 dependencies: stdplus_deps,
William A. Kennington III97e39472019-04-03 13:22:32 -070067 include_directories: stdplus_headers,
68 link_with: stdplus_lib)
69
William A. Kennington IIIb01c5572020-06-03 19:40:49 -070070stdplus_reqs = []
71foreach dep : stdplus_deps
72 if dep.type_name() == 'pkgconfig'
William A. Kennington III285fbcb2021-01-24 18:16:20 -080073 stdplus_reqs += dep
William A. Kennington IIIb01c5572020-06-03 19:40:49 -070074 endif
75endforeach
76
William A. Kennington III15982f62019-01-31 14:43:41 -080077import('pkgconfig').generate(
William A. Kennington III285fbcb2021-01-24 18:16:20 -080078 stdplus_lib,
William A. Kennington III15982f62019-01-31 14:43:41 -080079 description: 'C++ helper utilities',
80 version: meson.project_version(),
William A. Kennington IIIb01c5572020-06-03 19:40:49 -070081 requires: stdplus_reqs)