[Buildroot] [git commit] package/gtest: host-gtest install like a normal cmake package
Yann E. MORIN
yann.morin.1998 at free.fr
Sun Jan 9 20:53:40 UTC 2022
commit: https://git.buildroot.net/buildroot/commit/?id=c0f9e2447d57194f0b02edb93cd16a677ebb326c
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
Currently, host-gtest does not actually build and install gtest
libraries or header files; it just installs the gmock_gen stuff.
Host gtest can however be used by packages to build and run their
unit-tests natively.
This patch will now build and install gtest to the host like a normal
cmake package.
To limit the disruption for existing users of host-gtest, the gmock_gen
stuff is still installed (as a post-install hook now).
Signed-off-by: Paul Soucy <paul.soucy at sense.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
---
package/gtest/gtest.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
index 6447954e36..673e626c45 100644
--- a/package/gtest/gtest.mk
+++ b/package/gtest/gtest.mk
@@ -52,14 +52,14 @@ else
GTEST_CONF_OPTS += -DBUILD_GMOCK=OFF
endif
-define HOST_GTEST_INSTALL_CMDS
+define HOST_GTEST_POST_INSTALL_PYTHON
$(INSTALL) -D -m 0755 $(@D)/googlemock/scripts/generator/gmock_gen.py \
$(HOST_DIR)/bin/gmock_gen
cp -rp $(@D)/googlemock/scripts/generator/cpp \
$(HOST_GTEST_GMOCK_PYTHONPATH)
endef
+HOST_GTEST_POST_INSTALL_HOOKS += HOST_GTEST_POST_INSTALL_PYTHON
+
$(eval $(cmake-package))
-# The host package does not build anything, just installs gmock_gen stuff, so
-# it does not need to be a host-cmake-package.
-$(eval $(host-generic-package))
+$(eval $(host-cmake-package))
More information about the buildroot
mailing list