Line 0
Link Here
|
|
|
1 |
--- mesonbuild/modules/gnome.py.orig 2018-02-16 02:17:40 UTC |
2 |
+++ mesonbuild/modules/gnome.py |
3 |
@@ -19,6 +19,7 @@ from .. import build |
4 |
import os |
5 |
import copy |
6 |
import subprocess |
7 |
+from pathlib import PurePath |
8 |
from . import ModuleReturnValue |
9 |
from ..mesonlib import MesonException, OrderedSet, Popen_safe, extract_as_list |
10 |
from ..dependencies import Dependency, PkgConfigDependency, InternalDependency |
11 |
@@ -244,6 +245,15 @@ class GnomeModule(ExtensionModule): |
12 |
def exists_in_srcdir(f): |
13 |
return os.path.exists(os.path.join(state.environment.get_source_dir(), f)) |
14 |
|
15 |
+ def strip_subdir(f): |
16 |
+ if os.path.isabs(f): |
17 |
+ return f |
18 |
+ pure_f = str(PurePath(f)) |
19 |
+ prefix = os.path.commonpath([state.subdir, pure_f]) |
20 |
+ if pure_f.startswith(prefix): |
21 |
+ return pure_f[len(prefix) +1:] |
22 |
+ return f |
23 |
+ |
24 |
depends = [] |
25 |
subdirs = [] |
26 |
for resfile in dep_files[:]: |
27 |
@@ -282,6 +292,7 @@ class GnomeModule(ExtensionModule): |
28 |
'generated file, pass the target that generates it to ' |
29 |
'gnome.compile_resources() using the "dependencies" ' |
30 |
'keyword argument.' % (resfile, input_file)) |
31 |
+ dep_files[dep_files.index(resfile)] = strip_subdir(resfile) |
32 |
return dep_files, depends, subdirs |
33 |
|
34 |
def _get_link_args(self, state, lib, depends=None, include_rpath=False, |