Add use-libpldm-subproject option to meson.build Allow controlling whether libpldm is sourced from subprojects/libpldm.wrap or system/recipe dependency (recipe-sysroot). Defaults to true so unit test always use libpldm.wrap, while Bitbake set -Duse-libpldm-subproject=false to use the recipe-sysroot libpldm. Change-Id: I8887cf82130064e2864dfbc16d561219b5a479cb Signed-off-by: Muhammad Usama <muhammadusama@google.com>
diff --git a/meson.build b/meson.build index 58d6a05..678802e 100644 --- a/meson.build +++ b/meson.build
@@ -128,7 +128,11 @@ endif endif -libpldm_dep = subproject('libpldm').get_variable('libpldm_dep') +if get_option('use-libpldm-subproject') + libpldm_dep = subproject('libpldm').get_variable('libpldm_dep') +else + libpldm_dep = dependency('libpldm', fallback: ['libpldm', 'libpldm_dep']) +endif libbej_dep = dependency('libbej', fallback:['libbej']) libpldmutils_headers = ['.']
diff --git a/meson.options b/meson.options index 411d311..9413475 100644 --- a/meson.options +++ b/meson.options
@@ -181,3 +181,11 @@ description: '''Enable expand query option feature on redfish queries for rde devices. Disabled by default''' ) + +option( + 'use-libpldm-subproject', + type: 'boolean', + value: true, + description: 'Force using libpldm subproject wrap instead of system dependency' +) +