aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-06-14 14:11:47 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-06-14 14:55:49 +0000
commiteab0e5a8b3a575ead36fa99ac9154d6e960d4525 (patch)
tree426091cb5a74a74f148ea3d5fb5cf288cfa55e25 /mesonbuild/backend/backends.py
parente2379148a61f47107e7a84f235ca31f76fe26ac1 (diff)
downloadmeson-eab0e5a8b3a575ead36fa99ac9154d6e960d4525.zip
meson-eab0e5a8b3a575ead36fa99ac9154d6e960d4525.tar.gz
meson-eab0e5a8b3a575ead36fa99ac9154d6e960d4525.tar.bz2
windows: Canonicalize `:` in filenames
Fixes https://github.com/mesonbuild/meson/issues/7265
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index fc8c8df..68ae1a7 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -501,6 +501,12 @@ class Backend:
target.rpath_dirs_to_remove.update([d.encode('utf8') for d in result])
return tuple(result)
+ @staticmethod
+ def canonicalize_filename(fname):
+ for ch in ('/', '\\', ':'):
+ fname = fname.replace(ch, '_')
+ return fname
+
def object_filename_from_source(self, target, source):
assert isinstance(source, mesonlib.File)
build_dir = self.environment.get_build_dir()
@@ -531,7 +537,7 @@ class Backend:
source = os.path.relpath(os.path.join(build_dir, rel_src),
os.path.join(self.environment.get_source_dir(), target.get_subdir()))
machine = self.environment.machines[target.for_machine]
- return source.replace('/', '_').replace('\\', '_') + '.' + machine.get_object_suffix()
+ return self.canonicalize_filename(source) + '.' + machine.get_object_suffix()
def determine_ext_objs(self, extobj, proj_dir_to_build_root):
result = []