              if os.path.exists(d):
                  self.is_found = True
                  # Yes, we need both because there are multiple
--- 
-2.23.0
-

+        sub_src_dirs = ['src/gtest/src', 'src/googletest/googletest/src']
+        self.src_dirs = [os.path.join(sys.prefix, d) for d in sub_src_dirs]
         self.detect()
         self._add_sub_dependency(ThreadDependency, environment, kwargs)
 
@@ -149,7 +151,8 @@ class GMockDependency(ExternalDependency):
             self.prebuilt = True
             return
 
-        for d in ['/usr/src/googletest/googlemock/src', '/usr/src/gmock/src', '/usr/src/gmock']:

From 8eae8da137ab841408b5edd8223c9967dee819a1 Mon Sep 17 00:00:00 2001
From: Martin Ejdestig <marejde@gmail.com>
Date: Thu, 12 Sep 2019 18:46:53 +0200
Subject: [PATCH] dependencies/dev: use sys.prefix to find googletest and

 googlemock source

Can otherwise be problematic in cross compilation build environments. See
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13508 for Yocto bug.

---
 mesonbuild/dependencies/dev.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index 4ea3385..8cfa8a4 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -17,6 +17,7 @@
 
 import os
 import re
+import sys
 
 from .. import mlog
 from .. import mesonlib
@@ -31,7 +32,8 @@ class GTestDependency(ExternalDependency):
     def __init__(self, environment, kwargs):
         super().__init__('gtest', environment, 'cpp', kwargs)
         self.main = kwargs.get('main', False)
