aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dependencies.py8
-rw-r--r--mesonlib.py6
2 files changed, 9 insertions, 5 deletions
diff --git a/dependencies.py b/dependencies.py
index 9d0f3da..a9029bf 100644
--- a/dependencies.py
+++ b/dependencies.py
@@ -444,8 +444,8 @@ class GTestDependency(Dependency):
self.include_dir = '/usr/include'
self.src_include_dir = '/usr/src/gtest'
self.src_dir = '/usr/src/gtest/src'
- self.all_src = os.path.join(self.src_dir, 'gtest-all.cc')
- self.main_src = os.path.join(self.src_dir, 'gtest_main.cc')
+ self.all_src = mesonlib.File.from_absolute_file(os.path.join(self.src_dir, 'gtest-all.cc'))
+ self.main_src = mesonlib.File.from_absolute_file(os.path.join(self.src_dir, 'gtest_main.cc'))
self.detect()
def found(self):
@@ -526,8 +526,8 @@ class GMockDependency(Dependency):
# versions of gmock that do different things.
self.compile_args = ['-I/usr/src/gmock', '-I/usr/src/gmock/src']
self.link_args = []
- all_src = os.path.join(d, 'gmock-all.cc')
- main_src = os.path.join(d, 'gmock_main.cc')
+ all_src = mesonlib.File.from_absolute_file(os.path.join(d, 'gmock-all.cc'))
+ main_src = mesonlib.File.from_absolute_file(os.path.join(d, 'gmock_main.cc'))
if kwargs.get('main', False):
self.sources = [all_src, main_src]
else:
diff --git a/mesonlib.py b/mesonlib.py
index 313ffd6..cae5427 100644
--- a/mesonlib.py
+++ b/mesonlib.py
@@ -35,7 +35,11 @@ class File:
@staticmethod
def from_built_file(subdir, fname):
return File(True, subdir, fname)
-
+
+ @staticmethod
+ def from_absolute_file(fname):
+ return File(False, '', fname)
+
def rel_to_builddir(self, build_to_src):
if self.is_built:
return os.path.join(self.subdir, self.fname)