Add subprojects
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I1f9a13a8113ed632fa82d61acbf7c160d355cce8
diff --git a/meson.build b/meson.build
index 453fef2..0bb8aee 100644
--- a/meson.build
+++ b/meson.build
@@ -90,9 +90,39 @@
sources = []
if get_option('install-error-yaml').disabled()
sdbusplus_dep = dependency('sdbusplus')
- sdeventplus_dep = dependency('sdeventplus')
- phosphor_logging_dep = dependency('phosphor-logging')
- phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
+ if sdbusplus_dep.found()
+ sdbusplusplus_prog = find_program('sdbus++')
+ sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson')
+ else
+ sdbusplus_proj = subproject('sdbusplus', required: true)
+ sdbusplus_dep = sdbusplus_proj.get_variable('sdbusplus_dep')
+ sdbusplusplus_prog = sdbusplus_proj.get_variable('sdbusplusplus_prog')
+ sdbuspp_gen_meson_prog = sdbusplus_proj.get_variable(
+ 'sdbuspp_gen_meson_prog'
+ )
+ endif
+
+ sdeventplus_dep = dependency(
+ 'sdeventplus',
+ fallback: [
+ 'sdeventplus',
+ 'sdeventplus_dep'
+ ],
+ )
+ phosphor_logging_dep = dependency(
+ 'phosphor-logging',
+ fallback: [
+ 'phosphor-logging',
+ 'phosphor_logging_dep'
+ ],
+ )
+ phosphor_dbus_interfaces_dep = dependency(
+ 'phosphor-dbus-interfaces',
+ fallback: [
+ 'phosphor-dbus-interfaces',
+ 'phosphor_dbus_interfaces_dep'
+ ],
+ )
deps += [
sdbusplus_dep,
@@ -117,7 +147,11 @@
]
if get_option('with-host-communication-protocol')=='pldm'
- libpldm_dep = dependency('libpldm')
+ libpldm_dep = dependency(
+ 'libpldm',
+ fallback: ['pldm', 'libpldm_dep'],
+ default_options: ['libpldm-only=enabled', 'oem-ibm=enabled'],
+ )
deps += [
libpldm_dep,
]
diff --git a/subprojects/googletest.wrap b/subprojects/googletest.wrap
new file mode 100644
index 0000000..766a562
--- /dev/null
+++ b/subprojects/googletest.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/google/googletest.git
+revision = HEAD
diff --git a/subprojects/phosphor-dbus-interfaces.wrap b/subprojects/phosphor-dbus-interfaces.wrap
new file mode 100644
index 0000000..935a8b2
--- /dev/null
+++ b/subprojects/phosphor-dbus-interfaces.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/phosphor-dbus-interfaces.git
+revision = HEAD
diff --git a/subprojects/phosphor-logging.wrap b/subprojects/phosphor-logging.wrap
new file mode 100644
index 0000000..a039fcf
--- /dev/null
+++ b/subprojects/phosphor-logging.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/phosphor-logging.git
+revision = HEAD
diff --git a/subprojects/pldm.wrap b/subprojects/pldm.wrap
new file mode 100644
index 0000000..a49a2eb
--- /dev/null
+++ b/subprojects/pldm.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/pldm.git
+revision = HEAD
diff --git a/subprojects/sdbusplus.wrap b/subprojects/sdbusplus.wrap
new file mode 100644
index 0000000..d470130
--- /dev/null
+++ b/subprojects/sdbusplus.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/sdbusplus.git
+revision = HEAD
diff --git a/subprojects/sdeventplus.wrap b/subprojects/sdeventplus.wrap
new file mode 100644
index 0000000..085bb5e
--- /dev/null
+++ b/subprojects/sdeventplus.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/sdeventplus.git
+revision = HEAD