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.
This commit is contained in:
parent
a864269817
commit
6d1e182476
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue