blob: 4e84478716bd621a4f5180dfa5e2e44fbe57cb59 [file] [log] [blame]
Ed Tanous0bff6852023-07-27 09:23:42 -07001project(
2 'libpeci',
3 'c', 'cpp',
4 version : '1.0',
5 meson_version: '>=1.1.1',
6 default_options: [
7 'b_ndebug=if-release',
8 'cpp_rtti=false',
Patrick Williams110caf82023-08-23 06:31:05 -05009 'cpp_std=c++23',
Ed Tanous0bff6852023-07-27 09:23:42 -070010 'warning_level=3',
11 'werror=true',
12 ]
13)
14
Patrick Williamsf6e3f162023-11-29 06:45:02 -060015if (get_option('raw-peci').allowed())
Ed Tanous0bff6852023-07-27 09:23:42 -070016 sdbusplus = dependency('sdbusplus')
17
18 systemd = dependency('systemd', required: true)
19 systemd_system_unit_dir = systemd.get_variable(pkgconfig:
20 'systemdsystemunitdir'
21 )
22
23 boost = dependency('boost', version: '>=1.82')
24 add_project_arguments(
25 [
26 '-DBOOST_ASIO_DISABLE_THREADS',
27 '-DBOOST_ASIO_EXCEPTION_DISABLE',
28 '-DBOOST_ASIO_NO_DEPRECATED',
29 '-DBOOST_NO_RTTI',
30 '-DBOOST_NO_TYPEID',
31 ],
32 language : 'cpp'
33 )
34endif
35
36add_project_arguments(
37 [
38 '-Wcast-align',
39 '-Wconversion',
40 '-Wdouble-promotion',
41 '-Wduplicated-branches',
42 '-Wduplicated-cond',
43 '-Wformat=2',
44 '-Wlogical-op',
45 '-Wsign-conversion',
46 '-Wunused',
47 '-Wno-unused-parameter',
48 '-Wno-psabi',
49 ],
50 language : 'c'
51)
52
53add_project_arguments(
54 [
55 '-Wcast-align',
56 '-Wconversion',
57 '-Wdouble-promotion',
58 '-Wduplicated-branches',
59 '-Wduplicated-cond',
60 '-Wformat=2',
61 '-Wlogical-op',
62 '-Wnull-dereference',
63 '-Wsign-conversion',
64 '-Wunused',
65 '-Wno-psabi',
66 '-Wno-unused-parameter',
67 '-fno-rtti',
68 ],
69 language : 'cpp'
70)
71
72libpeci = library(
73 'peci',
74 'peci.c',
75 version: meson.project_version(),
76 install: true
77)
78install_headers('peci.h')
79
Jonathan Domandf5c8682023-08-02 18:42:01 -070080libpeci_dep = declare_dependency(
81 link_with: libpeci,
82 include_directories: include_directories('.')
83)
84
Ed Tanous0bff6852023-07-27 09:23:42 -070085bindir = get_option('prefix') + '/' + get_option('bindir')
86
87executable(
88 'peci_cmds',
89 'peci_cmds.c',
90 link_with: libpeci,
91 install: true,
92 install_dir: bindir
93)
94
Patrick Williamsf6e3f162023-11-29 06:45:02 -060095if (get_option('raw-peci').allowed())
Ed Tanous0bff6852023-07-27 09:23:42 -070096 executable(
97 'raw-peci',
98 'dbus_raw_peci.cpp',
99 dependencies: [
100 boost,
101 sdbusplus,
102 systemd,
103 ],
104 link_with: libpeci,
105 install: true,
106 install_dir: bindir
107 )
108 subdir('service_files')
109endif
110
111import('pkgconfig').generate(
112 libpeci,
113 name: meson.project_name(),
114 version: meson.project_version(),
115 description: 'PECI utilities',
116)