1
1
project (
2
2
' entity-manager' ,
3
3
' cpp' ,
4
- default_options : [
5
- ' warning_level=3' ,
6
- ' werror=true' ,
7
- ' cpp_std=c++23'
8
- ],
4
+ default_options : [' warning_level=3' , ' werror=true' , ' cpp_std=c++23' ],
9
5
license : ' Apache-2.0' ,
10
6
version : ' 0.1' ,
11
7
meson_version : ' >=1.1.1' ,
@@ -19,24 +15,25 @@ boost_args = [
19
15
' -DBOOST_NO_RTTI' ,
20
16
' -DBOOST_NO_TYPEID' ,
21
17
' -DBOOST_ALL_NO_LIB' ,
22
- ' -DBOOST_ALLOW_DEPRECATED_HEADERS'
18
+ ' -DBOOST_ALLOW_DEPRECATED_HEADERS' ,
23
19
]
24
20
build_tests = get_option (' tests' )
25
21
cpp = meson .get_compiler(' cpp' )
26
22
boost = dependency (' boost' , required : false )
27
23
if not boost.found()
28
- subproject (' boost' , required : false )
29
- boost = declare_dependency (
30
- include_directories : ' subprojects/boost_1_71_0' ,
31
- )
32
- boost = boost.as_system(' system' )
24
+ subproject (' boost' , required : false )
25
+ boost = declare_dependency (include_directories : ' subprojects/boost_1_71_0' )
26
+ boost = boost.as_system(' system' )
33
27
endif
34
28
if get_option (' fru-device' )
35
29
i2c = cpp.find_library (' i2c' )
36
30
endif
37
31
38
32
if get_option (' devicetree-vpd' )
39
- phosphor_dbus_interfaces_dep = dependency (' phosphor-dbus-interfaces' , include_type : ' system' )
33
+ phosphor_dbus_interfaces_dep = dependency (
34
+ ' phosphor-dbus-interfaces' ,
35
+ include_type : ' system' ,
36
+ )
40
37
endif
41
38
42
39
nlohmann_json_dep = dependency (' nlohmann_json' , include_type : ' system' )
@@ -46,7 +43,8 @@ phosphor_logging_dep = dependency('phosphor-logging')
46
43
systemd = dependency (' systemd' )
47
44
systemd_system_unit_dir = systemd.get_variable (
48
45
' systemdsystemunitdir' ,
49
- pkgconfig_define : [' prefix' , get_option (' prefix' )])
46
+ pkgconfig_define : [' prefix' , get_option (' prefix' )],
47
+ )
50
48
packagedir = join_paths (
51
49
get_option (' prefix' ),
52
50
get_option (' datadir' ),
@@ -63,7 +61,7 @@ if cpp.has_header('valijson/validator.hpp')
63
61
else
64
62
subproject (' valijson' , required : false )
65
63
valijson = declare_dependency (
66
- include_directories : ' subprojects/valijson/include'
64
+ include_directories : ' subprojects/valijson/include' ,
67
65
)
68
66
valijson = valijson.as_system(' system' )
69
67
endif
@@ -76,29 +74,19 @@ subdir('configurations')
76
74
filepaths = []
77
75
foreach c : configs
78
76
file = join_paths (' configurations' , c)
79
- install_data (
80
- file,
81
- install_dir : join_paths (
82
- packagedir,
83
- ' configurations' ,
84
- )
85
- )
77
+ install_data (file, install_dir : join_paths (packagedir, ' configurations' ))
86
78
filepaths += [file]
87
79
endforeach
88
80
89
81
if get_option (' validate-json' )
90
82
validate_script = files (' scripts/validate_configs.py' )
91
83
autojson = custom_target (
92
- ' check_syntax' ,
93
- command : [
94
- validate_script,
95
- ' -v' ,
96
- ' -k' ,
97
- ],
98
- depend_files : files (filepaths),
99
- build_by_default : true ,
100
- capture : true ,
101
- output : ' validate_configs.log' ,
84
+ ' check_syntax' ,
85
+ command : [validate_script, ' -v' , ' -k' ],
86
+ depend_files : files (filepaths),
87
+ build_by_default : true ,
88
+ capture : true ,
89
+ output : ' validate_configs.log' ,
102
90
)
103
91
endif
104
92
@@ -121,11 +109,7 @@ schemas = [
121
109
foreach s : schemas
122
110
install_data (
123
111
join_paths (' schemas' , s),
124
- install_dir : join_paths (
125
- packagedir,
126
- ' configurations' ,
127
- ' schemas' ,
128
- )
112
+ install_dir : join_paths (packagedir, ' configurations' , ' schemas' ),
129
113
)
130
114
endforeach
131
115
@@ -141,7 +125,9 @@ if not build_tests.disabled()
141
125
gtest_subproject = cmake.subproject (' gtest' )
142
126
cm_gtest = gtest_subproject.dependency (' gtest' )
143
127
cm_gtest_main = gtest_subproject.dependency (' gtest_main' )
144
- gtest = declare_dependency (dependencies : [cm_gtest, cm_gtest_main, threads])
128
+ gtest = declare_dependency (
129
+ dependencies : [cm_gtest, cm_gtest_main, threads],
130
+ )
145
131
gmock = gtest_subproject.dependency (' gmock' )
146
132
147
133
endif
@@ -163,7 +149,7 @@ if not build_tests.disabled()
163
149
valijson,
164
150
],
165
151
include_directories : ' src' ,
166
- )
152
+ ),
167
153
)
168
154
169
155
test (
@@ -174,14 +160,9 @@ if not build_tests.disabled()
174
160
' src/fru_utils.cpp' ,
175
161
' src/fru_reader.cpp' ,
176
162
cpp_args : test_boost_args,
177
- dependencies : [
178
- boost,
179
- gtest,
180
- phosphor_logging_dep,
181
- sdbusplus,
182
- ],
163
+ dependencies : [boost, gtest, phosphor_logging_dep, sdbusplus],
183
164
include_directories : ' src' ,
184
- )
165
+ ),
185
166
)
186
167
187
168
test (
@@ -198,6 +179,6 @@ if not build_tests.disabled()
198
179
phosphor_logging_dep,
199
180
],
200
181
include_directories : ' src' ,
201
- )
182
+ ),
202
183
)
203
184
endif
0 commit comments