Add libpldm-only option
The libpldm library in this repo is supposed to be built and used by
users outside of OpenBMC.
Adding libpldm-only option to make it possible to build only libpldm
without any dependency.
Tested: Run meson with `-Dlibpldm-only=enabled` and verify it only
builds libpldm without OpenBMC environment.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I78f2f9866c14372d3afbc9863f6fbd695aad13f1
diff --git a/meson.build b/meson.build
index 3a9977b..6c8ef3a 100644
--- a/meson.build
+++ b/meson.build
@@ -31,6 +31,8 @@
subdir('libpldm')
+if get_option('libpldm-only').disabled()
+
libpldmutils_headers = ['.']
libpldmutils = library(
'pldmutils',
@@ -77,3 +79,5 @@
if get_option('utilities').enabled()
subdir('utilities')
endif
+
+endif # pldm-only
diff --git a/meson_options.txt b/meson_options.txt
index 1c059db..00ef185 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,3 +3,5 @@
option('oem-ibm', type: 'feature', description: 'Enable IBM OEM PLDM', value: 'enabled')
option('requester-api', type: 'feature', description: 'Enable libpldm requester API', value: 'enabled')
option('utilities', type: 'feature', description: 'Enable debug utilities', value: 'enabled')
+
+option('libpldm-only', type: 'feature', description: 'Only build libpldm', value: 'disabled')