diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-06-11 00:27:18 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-06-11 00:27:18 +0300 |
commit | de941eb4f6eb9ac533d83d86a554fc22ead84242 (patch) | |
tree | 2f3c659359527ea81ec3f4c64d79ccdd64db2bf2 /backends.py | |
parent | b63281d37a9bf9448021d116ddfd9e69854f4dc5 (diff) | |
download | meson-de941eb4f6eb9ac533d83d86a554fc22ead84242.zip meson-de941eb4f6eb9ac533d83d86a554fc22ead84242.tar.gz meson-de941eb4f6eb9ac533d83d86a554fc22ead84242.tar.bz2 |
Fix extract_object in a subproject.
Diffstat (limited to 'backends.py')
-rw-r--r-- | backends.py | 8 |
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) |