From: Carlos Santos Date: Wed, 19 Apr 2017 11:51:52 +0000 (-0300) Subject: gtest: fix usage on ARM platforms X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2026621f3c60167aa8ba48e658be1b214d1347d7;p=buildroot.git 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 Signed-off-by: Thomas Petazzoni --- 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)