From: Joe Slater <[email protected]>

Add a PACKAGECONFIG option to produce shared libraries.
Change the -dev RDEPENDS because -staticdev is not created
if shared libraries are built.

Signed-off-by: Joe Slater <[email protected]>
---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta-oe/recipes-test/googletest/googletest_1.14.0.bb 
b/meta-oe/recipes-test/googletest/googletest_1.14.0.bb
index 8c75f936de..e9df082d32 100644
--- a/meta-oe/recipes-test/googletest/googletest_1.14.0.bb
+++ b/meta-oe/recipes-test/googletest/googletest_1.14.0.bb
@@ -10,12 +10,20 @@ S = "${WORKDIR}/git"
 SRCREV = "f8d7d77c06936315286eb55f8de22cd23c188571"
 SRC_URI = "git://github.com/google/googletest.git;branch=main;protocol=https"
 
-inherit cmake
+inherit cmake pkgconfig
+
+# allow for shared libraries, but do not default to them
+#
+PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"
+
 
 ALLOW_EMPTY:${PN} = "1"
 ALLOW_EMPTY:${PN}-dbg = "1"
 
-RDEPENDS:${PN}-dev += "${PN}-staticdev"
+# -staticdev will not be implicitly put into an SDK, so we add an rdepend
+# if we are not building shared libraries
+#
+RDEPENDS:${PN}-dev += 
"${@bb.utils.contains("PACKAGECONFIG","shared","","${PN}-staticdev",d)}"
 
 BBCLASSEXTEND = "native nativesdk"
 
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#109181): 
https://lists.openembedded.org/g/openembedded-devel/message/109181
Mute This Topic: https://lists.openembedded.org/mt/104776601/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to