Skip to content

Commit ef17a25

Browse files
meson: adjust nlohmann-json dependency
- Simplify the dependency logic in the meson.build. - Align the meson dep name with consistent practices from other repos. - Use the non-versioned wrap file. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0e3052763bffe9f98d8ca10c5b523b58e000f636
1 parent 3494a57 commit ef17a25

File tree

7 files changed

+10
-21
lines changed

7 files changed

+10
-21
lines changed

control/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ deps=[
1515
sources = ['main.cpp']
1616

1717
if conf.has('CONTROL_USE_JSON')
18-
deps += json_dep
18+
deps += nlohmann_json_dep
1919
include_dirs += [
2020
'./json',
2121
'./json/actions',
@@ -100,7 +100,7 @@ fanctl = executable(
100100
'fanctl.cpp',
101101
dependencies: [
102102
cli11_dep,
103-
json_dep,
103+
nlohmann_json_dep,
104104
phosphor_logging_dep,
105105
sdbusplus_dep,
106106
],

meson.build

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ if not has_cereal
4646
cereal_dep = cereal_proj.dependency('cereal')
4747
endif
4848

49-
if cpp.has_header('nlohmann/json.hpp')
50-
json_dep = declare_dependency()
51-
else
52-
json_dep = dependency('nlohmann_json')
53-
endif
54-
49+
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
5550
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
5651
phosphor_logging_dep = dependency('phosphor-logging')
5752
sdbusplus_dep = dependency('sdbusplus')

monitor/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sources=[
1717
]
1818

1919
deps=[
20-
json_dep,
20+
nlohmann_json_dep,
2121
phosphor_dbus_interfaces_dep,
2222
phosphor_logging_dep,
2323
sdbusplus_dep,

monitor/test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ phosphor_fan_monitor_test_include_directories = include_directories(
55
test_deps=[
66
gmock_dep,
77
gtest_dep,
8-
json_dep,
8+
nlohmann_json_dep,
99
phosphor_logging_dep,
1010
sdeventplus_dep
1111
]

presence/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ sources=[
1919
]
2020

2121
deps=[
22-
json_dep,
2322
libevdev_dep,
23+
nlohmann_json_dep,
2424
phosphor_dbus_interfaces_dep,
2525
phosphor_logging_dep,
2626
sdbusplus_dep,

subprojects/nlohmann_json.wrap

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
[wrap-file]
2-
directory = nlohmann_json-3.9.1
3-
lead_directory_missing = true
4-
source_url = https://github.com/nlohmann/json/releases/download/v3.9.1/include.zip
5-
source_filename = nlohmann_json-3.9.1.zip
6-
source_hash = 6bea5877b1541d353bd77bdfbdb2696333ae5ed8f9e8cc22df657192218cad91
7-
patch_url = https://wrapdb.mesonbuild.com/v1/projects/nlohmann_json/3.9.1/1/get_zip
8-
patch_filename = nlohmann_json-3.9.1-1-wrap.zip
9-
patch_hash = 1774e5506fbe3897d652f67e41973194b948d2ab851cf464a742f35f160a1435
1+
[wrap-git]
2+
revision = HEAD
3+
url = https://github.com/nlohmann/json.git
104

115
[provide]
126
nlohmann_json = nlohmann_json_dep

test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_include_directories = include_directories(
66
test_deps=[
77
gmock_dep,
88
gtest_dep,
9-
json_dep,
9+
nlohmann_json_dep,
1010
phosphor_dbus_interfaces_dep,
1111
phosphor_logging_dep,
1212
sdbusplus_dep

0 commit comments

Comments
 (0)