xref: /openbmc/openbmc/meta-openembedded/meta-oe/recipes-test/googletest/googletest_1.16.0.bb (revision eaae0b339f806200d8722cb09e5e3b83c15a5956)
1DESCRIPTION = "Google's framework for writing C++ tests"
2HOMEPAGE = "https://github.com/google/googletest"
3SECTION = "libs"
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=cbbd27594afd089daa160d3a16dd515a"
6
7PROVIDES += "gmock gtest"
8
9S = "${WORKDIR}/git"
10SRCREV = "6910c9d9165801d8827d628cb72eb7ea9dd538c5"
11SRC_URI = "git://github.com/google/googletest.git;branch=v1.16.x;protocol=https \
12    file://gtest-ciso646.patch \
13"
14
15inherit cmake pkgconfig
16
17# allow for shared libraries, but do not default to them
18#
19PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,,"
20
21CXXFLAGS:append = " -fPIC"
22
23ALLOW_EMPTY:${PN} = "1"
24ALLOW_EMPTY:${PN}-dbg = "1"
25
26# -staticdev will not be implicitly put into an SDK, so we add an rdepend
27# if we are not building shared libraries
28#
29RDEPENDS:${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG","shared","","${PN}-staticdev",d)}"
30
31BBCLASSEXTEND = "native nativesdk"
32
33do_configure:prepend() {
34    # explicitly use python3
35    # the scripts are already python3 compatible since https://github.com/google/googletest/commit/d404af0d987a9c38cafce82a7e26ec8468c88361 and other fixes like this
36    # but since this oe-core change http://git.openembedded.org/openembedded-core/commit/?id=5f8f16b17f66966ae91aeabc23e97de5ecd17447
37    # there isn't python in HOSTTOOLS so "env python" fails
38    sed -i 's@^#!/usr/bin/env python$@#!/usr/bin/env python3@g' ${S}/googlemock/test/*py ${S}/googletest/test/*py
39}
40