summaryrefslogtreecommitdiffstats
path: root/package/gtest
diff options
context:
space:
mode:
authorCarlos Santos <casantos@datacom.ind.br>2017-04-19 08:51:52 -0300
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-04-20 22:31:53 +0200
commit2026621f3c60167aa8ba48e658be1b214d1347d7 (patch)
treefa05ba10f27487e12617613b315320ca10c1d85d /package/gtest
parent7b394c4926dcb860a356eeb46b1f1f5d807041f7 (diff)
downloadbuildroot-2026621f3c60167aa8ba48e658be1b214d1347d7.tar.gz
buildroot-2026621f3c60167aa8ba48e658be1b214d1347d7.zip
gtest: fix usage on ARM platforms
Ensure that GTest is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/gtest')
-rw-r--r--package/gtest/gtest.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
index 9e6914109a..337a168dfb 100644
--- a/package/gtest/gtest.mk
+++ b/package/gtest/gtest.mk
@@ -37,6 +37,13 @@ HOST_GTEST_GMOCK_PYTHONPATH = \
# the gtest sources.
GTEST_CONF_OPTS = -DBUILD_SHARED_LIBS=OFF
+# Ensure that GTest is compiled with -fPIC to allow linking the static
+# libraries with dynamically linked programs. This is not a requirement
+# for most architectures but is mandatory for ARM.
+ifeq ($(BR2_STATIC_LIBS),)
+GTEST_CONF_OPTS += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+endif
+
GTEST_CONF_OPTS += -DBUILD_GTEST=ON
ifeq ($(BR2_PACKAGE_GTEST_GMOCK),y)
OpenPOWER on IntegriCloud