Skip to content

Commit

Permalink
meson: add necessary subprojects
Browse files Browse the repository at this point in the history
Enable the project to build outside of the OpenBMC Docker or Yocto
environments by providing subproject wrap files as necessary.  In
some cases, this requires adding additional dependencies in the meson
file due to them not currently being expressed.

Supply a .gitignore that is appropriate for a Meson project as the
current one seems to be from the time when this project used autoconf.

Signed-off-by: Patrick Williams <[email protected]>
Change-Id: Iea2ae8cb9e00d2aa726800ff09b42d93efc886fc
  • Loading branch information
williamspatrick committed Jul 13, 2023
1 parent 2aaf936 commit a83fae5
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 29 deletions.
30 changes: 3 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
# Test suite logs
*.log

# Code Coverage
*.gcda
*.gcno
*.trs
*-coverage*

pidlist-gen.cpp
sensorlist-gen.cpp
zoneinfo-gen.cpp
setsensor
swampd
*_unittest
*_unittest.log
*_unittest.trs
test-suite.log

# IDEs
.idea/

# Patches
.pc/
patches/

phosphor-pid-control.service
build*/
subprojects/*
!subprojects/*.wrap
20 changes: 18 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ project(
]
)

cxx = meson.get_compiler('cpp')

conf_data = configuration_data()

bindir = get_option('prefix') / get_option('bindir')
Expand Down Expand Up @@ -50,12 +52,26 @@ sdbusplus_dep = dependency('sdbusplus')
libsystemd_dep = dependency('libsystemd')
ipmid_dep = dependency('libipmid')

if cxx.has_header('nlohmann/json.hpp')
nlohmann_json_dep = declare_dependency()
else
nlohmann_json_dep = dependency('nlohmann-json')
endif

if cxx.has_header('CLI/CLI.hpp')
CLI11_dep = declare_dependency()
else
CLI11_dep = dependency('CLI11')
endif

deps = [
CLI11_dep,
ipmid_dep,
libsystemd_dep,
nlohmann_json_dep,
phosphor_dbus_interfaces_dep,
phosphor_logging_dep,
sdbusplus_dep,
libsystemd_dep,
ipmid_dep,
]

root_inc = include_directories(
Expand Down
6 changes: 6 additions & 0 deletions subprojects/CLI11.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-git]
url = https://github.com/CLIUtils/CLI11.git
revision = HEAD

[provide]
CLI11 = CLI11_dep
6 changes: 6 additions & 0 deletions subprojects/nlohmann-json.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-git]
url = https://github.com/nlohmann/json
revision = HEAD

[provide]
nlohmann-json = nlohmann_json_dep
3 changes: 3 additions & 0 deletions subprojects/phosphor-dbus-interfaces.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[wrap-git]
url = https://github.com/openbmc/phosphor-dbus-interfaces.git
revision = HEAD
8 changes: 8 additions & 0 deletions subprojects/phosphor-host-ipmid.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[wrap-git]
url = https://github.com/openbmc/phosphor-host-ipmid
revision = HEAD

[provide]
libipmid = ipmid_dep
libchannellayer = channellayer_dep
libuserlayer = userlayer_dep
6 changes: 6 additions & 0 deletions subprojects/phosphor-logging.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-git]
url = https://github.com/openbmc/phosphor-logging.git
revision = HEAD

[provide]
phosphor-logging = phosphor_logging_dep
7 changes: 7 additions & 0 deletions subprojects/sdbusplus.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[wrap-git]
url = https://github.com/openbmc/sdbusplus.git
revision = HEAD

[provide]
sdbusplus = sdbusplus_dep
program_names = sdbus++, sdbus++-gen-meson

0 comments on commit a83fae5

Please sign in to comment.