aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-06-11 00:27:18 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-06-11 00:27:18 +0300
commitde941eb4f6eb9ac533d83d86a554fc22ead84242 (patch)
tree2f3c659359527ea81ec3f4c64d79ccdd64db2bf2
parentb63281d37a9bf9448021d116ddfd9e69854f4dc5 (diff)
downloadmeson-de941eb4f6eb9ac533d83d86a554fc22ead84242.zip
meson-de941eb4f6eb9ac533d83d86a554fc22ead84242.tar.gz
meson-de941eb4f6eb9ac533d83d86a554fc22ead84242.tar.bz2
Fix extract_object in a subproject.
-rw-r--r--backends.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/backends.py b/backends.py
index c4ee0bb..424d900 100644
--- a/backends.py
+++ b/backends.py
@@ -170,7 +170,13 @@ class Backend():
osrc_base = osrc.fname
if not self.source_suffix_in_objs:
osrc_base = '.'.join(osrc.split('.')[:-1])
- objbase = os.path.join(osrc.subdir, osrc.fname).replace('/', '_').replace('\\', '_')
+ # If extracting in a subproject, the subproject
+ # name gets duplicated in the file name.
+ pathsegs = osrc.subdir.split(os.sep)
+ if pathsegs[0] == 'subprojects':
+ pathsegs = pathsegs[2:]
+ fixedpath = os.sep.join(pathsegs)
+ objbase = os.path.join(fixedpath, osrc.fname).replace('/', '_').replace('\\', '_')
objname = os.path.join(proj_dir_to_build_root,
targetdir, os.path.basename(objbase) + suffix)
result.append(objname)