Skip to contentSkip to conversation

googletest: allow for shared libraries

PATCH Superseded [email protected] 2 participants 4 messages Mar 4, 2024 – Mar 5, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 googletest: allow for shared libraries

From: Joe Slater <[email protected]>

Add a PACKAGECONFIG option to produce shared libraries. Allow staticdev to be empty if no static libraries are built.

---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +7 -1
index 8c75f936de..1b05f3d336 100644
@@ -10,11 +10,17 @@ 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"
 
+ALLOW_EMPTY:${PN}-staticdev = "1"
 RDEPENDS:${PN}-dev += "${PN}-staticdev"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Joe Slater via lists.openembedded.org

From: Joe Slater <[email protected]>

Add a PACKAGECONFIG option to produce shared libraries. Allow staticdev to be empty if no static libraries are built.

why would be not build static libs ? and if we do not then why do we need to create
empty package ?

Quoted 40 lines
---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +7 -2
index 8c75f936de..1b05f3d336 100644
@@ -10,11 +10,17 @@ 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"
 
+ALLOW_EMPTY:${PN}-staticdev = "1"
 RDEPENDS:${PN}-dev += "${PN}-staticdev"
 
 BBCLASSEXTEND = "native nativesdk"
--

2.25.1

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

#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: Monday, March 4, 2024 3:50 PM
To: Slater, Joseph <[email protected]>
Cc: [email protected]; MacLeod, Randy <[email protected]>
Subject: Re: [oe] [meta-oe][PATCH 1/1] googletest: allow for shared libraries

Quoted 1 line · Joe Slater via lists.openembedded.org
Quoted 8 lines
Quoted 5 lines

From: Joe Slater <[email protected]>

Add a PACKAGECONFIG option to produce shared libraries. Allow staticdev to be empty if no static libraries are built.

why would be not build static libs ? and if we do not then why do we need to create empty package ?

If we set -DBUILD_SHARED_LIBS=ON static libs will not be built and -staticdev will not be created, so -dev will produce an error if we try to, for example, populate an sdk. I guess we could put static libs in -dev and get rid of -staticdev, but I didn't want to mess with the packaging.

Joe

Quoted 45 lines
Quoted 12 lines
---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +0 -0
index 8c75f936de..1b05f3d336 100644

meta-oe/recipes-test/googletest/googletest_1.14.0.bb S = "${WORKDIR}/git" · line 11

Quoted 2 lines
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +0 -0
@@ -10,11 +10,17 @@ S = "${WORKDIR}/git"
 SRCREV = "f8d7d77c06936315286eb55f8de22cd23c188571"
 SRC_URI =

"git://github.com/google/googletest.git;branch=main;protocol=https"

meta-oe/recipes-test/googletest/googletest_1.14.0.bb S = "${WORKDIR}/git"

Quoted 6 lines
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +4 -1
-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,,"

Quoted 13 lines
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +2 -1
+
 
 ALLOW_EMPTY:${PN} = "1"
 ALLOW_EMPTY:${PN}-dbg = "1"
 
+ALLOW_EMPTY:${PN}-staticdev = "1"
 RDEPENDS:${PN}-dev += "${PN}-staticdev"
 
 BBCLASSEXTEND = "native nativesdk"
--

2.25.1

Quoted 3 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#109103):

https://lists.openembedded.org/g/openembedded-devel/message/109103

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/104732413/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub

[[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 16 lines · Joseph
Quoted 16 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: Monday, March 4, 2024 3:50 PM
To: Slater, Joseph <[email protected]>
Cc: [email protected]; MacLeod, Randy <[email protected]>
Subject: Re: [oe] [meta-oe][PATCH 1/1] googletest: allow for shared libraries

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

From: Joe Slater <[email protected]>

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Add a PACKAGECONFIG option to produce shared libraries. Allow staticdev to be empty if no static libraries are built.

why would be not build static libs ? and if we do not then why do we need to create empty package ?

If we set -DBUILD_SHARED_LIBS=ON static libs will not be built and -staticdev will not be created, so -dev will produce an error if we try to, for example, populate an sdk. I guess we could put static libs in -dev and get rid of -staticdev, but I didn't want to mess with the packaging.

maybe you can unbuckle the rdep for dev on staticdev package

Quoted 47 lines

Joe

Quoted 45 lines
Quoted 12 lines
---
 meta-oe/recipes-test/googletest/googletest_1.14.0.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +0 -0
index 8c75f936de..1b05f3d336 100644

meta-oe/recipes-test/googletest/googletest_1.14.0.bb S = "${WORKDIR}/git" · line 11

Quoted 2 lines
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +0 -0
@@ -10,11 +10,17 @@ S = "${WORKDIR}/git"
 SRCREV = "f8d7d77c06936315286eb55f8de22cd23c188571"
 SRC_URI =

"git://github.com/google/googletest.git;branch=main;protocol=https"

meta-oe/recipes-test/googletest/googletest_1.14.0.bb S = "${WORKDIR}/git"

Quoted 6 lines
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +4 -1
-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,,"

Quoted 13 lines
meta-oe/recipes-test/googletest/googletest_1.14.0.bb +2 -1
+
 
 ALLOW_EMPTY:${PN} = "1"
 ALLOW_EMPTY:${PN}-dbg = "1"
 
+ALLOW_EMPTY:${PN}-staticdev = "1"
 RDEPENDS:${PN}-dev += "${PN}-staticdev"
 
 BBCLASSEXTEND = "native nativesdk"
--

2.25.1

Quoted 3 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#109103):

https://lists.openembedded.org/g/openembedded-devel/message/109103

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/104732413/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub

[[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-