Skip to contentSkip to conversation

googletest: allow for shared libraries

PATCH In review [email protected] 2 participants 2 messages Mar 6, 2024 – Mar 7, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 googletest: allow for shared libraries

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.

---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +10 -2
index 8c75f936de..e9df082d32 100644
@@ -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"
 
Signature · 1 line
2.25.1
#1 lore raw

I accepted v2, can you rebase this on top of master and resend the delta as v2?

Quoted 51 lines · Joe Slater via lists.openembedded.org

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.

---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +10 -3
index 8c75f936de..e9df082d32 100644
@@ -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/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-