Skip to content

Commit e2bb43a

Browse files
rossburtoneli-schwartz
authored andcommitted
dependencies/dev: prepend sysroot when searching for GTest sources
Don't hardcode paths in /usr when looking for the GTest sources, as in cross-compile or other builds with a sysroot this will find the host sources, not ones that we want to use in the sysroot. Closes #12690. (cherry picked from commit 17117c2)
1 parent feef4da commit e2bb43a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mesonbuild/dependencies/dev.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ class GTestDependencySystem(SystemDependency):
5656
def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
5757
super().__init__(name, environment, kwargs, language='cpp')
5858
self.main = kwargs.get('main', False)
59-
self.src_dirs = ['/usr/src/gtest/src', '/usr/src/googletest/googletest/src']
59+
60+
sysroot = environment.properties[self.for_machine].get_sys_root() or ''
61+
self.src_dirs = [sysroot + '/usr/src/gtest/src', sysroot + '/usr/src/googletest/googletest/src']
6062
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
6163
self.is_found = False
6264
return

0 commit comments

Comments
 (0)