aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bacci <luca.bacci982@gmail.com>2021-10-07 16:20:06 +0200
committerEli Schwartz <eschwartz93@gmail.com>2021-10-07 21:52:18 -0400
commit6d1e18247650b59a47ee7cdb200be0ef38d3b258 (patch)
tree31ca48e1536206c16c388775dbe297b2632c8314
parenta864269817aee6ad2d524058fcdcd3e0ea843677 (diff)
downloadmeson-6d1e18247650b59a47ee7cdb200be0ef38d3b258.zip
meson-6d1e18247650b59a47ee7cdb200be0ef38d3b258.tar.gz
meson-6d1e18247650b59a47ee7cdb200be0ef38d3b258.tar.bz2
Windows module: Make path flattening for windres work in more cases
If either 'name' or 'name_formatted' are absolute paths, then they are of the form: C:\path/to/file.ext (example) By only substituting slashes with the underscore, we get: C:_path_to_file.ext This is still not quite right, infact os.path.basename() returns: _path_to_file.ext Also replace colons with underscores to overcome issues when absolute paths are involved.
-rw-r--r--mesonbuild/modules/windows.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index 7f627cf..8f1af2c 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -145,8 +145,8 @@ class WindowsModule(ExtensionModule):
raise MesonException(f'Unexpected source type {src!r}. windows.compile_resources accepts only strings, files, custom targets, and lists thereof.')
# Path separators are not allowed in target names
- name = name.replace('/', '_').replace('\\', '_')
- name_formatted = name_formatted.replace('/', '_').replace('\\', '_')
+ name = name.replace('/', '_').replace('\\', '_').replace(':', '_')
+ name_formatted = name_formatted.replace('/', '_').replace('\\', '_').replace(':', '_')
res_kwargs = {
'output': name + '_@BASENAME@.' + suffix,