blob: 6546845715a46d28a53ba5e41023706f78c115f1 [file] [log] [blame]
Andre McCurdy1ea3f662016-12-15 06:11:31 -08001DESCRIPTION = "Google's framework for writing C++ tests"
Brad Bishop26bdd442019-08-16 17:08:17 -04002HOMEPAGE = "https://github.com/google/googletest"
Andre McCurdy1ea3f662016-12-15 06:11:31 -08003SECTION = "libs"
4LICENSE = "BSD-3-Clause"
William A. Kennington IIIb95905d2021-06-02 12:40:56 -07005LIC_FILES_CHKSUM = "file://LICENSE;md5=cbbd27594afd089daa160d3a16dd515a"
Andre McCurdy1ea3f662016-12-15 06:11:31 -08006
Brad Bishop26bdd442019-08-16 17:08:17 -04007PROVIDES += "gmock gtest"
Andre McCurdy1ea3f662016-12-15 06:11:31 -08008
Brad Bishop316dfdd2018-06-25 12:45:53 -04009S = "${WORKDIR}/git"
Andrew Geissler5082cc72023-09-11 08:41:39 -040010SRCREV = "f8d7d77c06936315286eb55f8de22cd23c188571"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050011SRC_URI = "git://github.com/google/googletest.git;branch=main;protocol=https"
Andre McCurdy1ea3f662016-12-15 06:11:31 -080012
Patrick Williamsb58112e2024-03-07 11:16:36 -060013inherit cmake pkgconfig
14
15# allow for shared libraries, but do not default to them
16#
17PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"
18
Patrick Williams03514f12024-04-05 07:04:11 -050019CXXFLAGS:append = " -fPIC"
Andre McCurdy1ea3f662016-12-15 06:11:31 -080020
Patrick Williams213cb262021-08-07 19:21:33 -050021ALLOW_EMPTY:${PN} = "1"
22ALLOW_EMPTY:${PN}-dbg = "1"
Andre McCurdy1ea3f662016-12-15 06:11:31 -080023
Patrick Williams03514f12024-04-05 07:04:11 -050024# -staticdev will not be implicitly put into an SDK, so we add an rdepend
25# if we are not building shared libraries
26#
27RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG","shared","","${PN}-staticdev",d)}"
Andre McCurdy1ea3f662016-12-15 06:11:31 -080028
29BBCLASSEXTEND = "native nativesdk"
Brad Bishope42b3e32020-01-15 22:08:42 -050030
Patrick Williams213cb262021-08-07 19:21:33 -050031do_configure:prepend() {
Brad Bishope42b3e32020-01-15 22:08:42 -050032 # explicitly use python3
33 # the scripts are already python3 compatible since https://github.com/google/googletest/commit/d404af0d987a9c38cafce82a7e26ec8468c88361 and other fixes like this
34 # but since this oe-core change http://git.openembedded.org/openembedded-core/commit/?id=5f8f16b17f66966ae91aeabc23e97de5ecd17447
35 # there isn't python in HOSTTOOLS so "env python" fails
Patrick Williams58776372022-04-13 09:07:35 -050036 sed -i 's@^#!/usr/bin/env python$@#!/usr/bin/env python3@g' ${S}/googlemock/test/*py ${S}/googletest/test/*py
Brad Bishope42b3e32020-01-15 22:08:42 -050037}