Googletest in imx-image-full and SDK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Googletest in imx-image-full and SDK

940 Views
lchen
Contributor III

Hi,

I built the imx-image-full and SDK images for imx8qmmek board. I need the gtest shared libs libgtest.so & libgtest_main.so, and they are not available on the target,  but the static libs libgtest.a, libgtest_main.a are present in the SDK cortexa72-cortexa53-crypto-poky-linux sysroot.

I guess I can add IMAGE_INSTALL_append = " googletest" in local.conf to have gtest built in the image. However, I noticed there are 2 googletest recipe files in 2 separated layers:

meta-imx/meta-bsp/recipes-test/googletest/googletest_git.bb

meta-openembedded/meta-oe/recipes-test/googletest/googletest_git.bb

My questions are:

why the SDK (through polulate_sdk) sysroot has gtest static libs in the first place?

which recipe file I should change to build share libs instead of static libs in both target image and SDK image, and how to change?

Thanks,

Lijun

0 Kudos
2 Replies

933 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

Try to change gmock_main.pc.in:

Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ -DBUILD_SHARED_LIBS=ON
0 Kudos

918 Views
lchen
Contributor III

Thanks for the quick reply. To change the file gmock_main.pc.in, how do I patch it in the yocto recipe file? By the way, the two yocto recipes for google test, which one is being used?

meta-imx/meta-bsp/recipes-test/googletest/googletest_git.bb

meta-openembedded/meta-oe/recipes-test/googletest/googletest_git.bb

 

Thanks,

0 Kudos