summaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorL. E. Segovia <amy@amyspark.me>2023-08-31 23:48:02 -0300
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2025-07-13 17:57:40 +0530
commit12563f74a9f3dda70dcd4778aa958de355d1fae7 (patch)
treef6605b0e7c0fb35fc18a529c80b0ac8f2403d5bd /mesonbuild/mintro.py
parent9ca276442eaaa6cb0ef3b595f3c679aabad15a39 (diff)
downloadmeson-12563f74a9f3dda70dcd4778aa958de355d1fae7.tar.gz
backends: Use POSIX paths for target paths
This commit completes 5de09cbe8838e8febf1ca3aa83b53cf06972bff3, ensuring that only POSIX style paths are passed to the compiler line, and thus fixing UNIX-style tools that treat single backward slashes as Unicode escaped characters. Fixes #12191 Completes #12534 Completes #12564
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 6986186bd..57fa286b7 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -128,7 +128,7 @@ def list_installed(installdata: backends.InstallData) -> T.Dict[str, str]:
def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[str, T.Dict[str, T.Optional[str]]]]:
plan: T.Dict[str, T.Dict[str, T.Dict[str, T.Optional[str]]]] = {
'targets': {
- os.path.join(installdata.build_dir, target.fname): {
+ Path(installdata.build_dir, target.fname).as_posix(): {
'destination': target.out_name,
'tag': target.tag or None,
'subproject': target.subproject or None,
@@ -145,13 +145,14 @@ def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[s
}.items():
# Mypy doesn't recognize SubdirInstallData as a subclass of InstallDataBase
for data in data_list: # type: ignore[attr-defined]
+ data_path = Path(data.path).as_posix()
data_type = data.data_type or key
- install_path_name = data.install_path_name
+ install_path_name = Path(data.install_path_name)
if key == 'headers': # in the headers, install_path_name is the directory
- install_path_name = os.path.join(install_path_name, os.path.basename(data.path))
+ install_path_name = install_path_name / os.path.basename(data.path)
entry = {
- 'destination': install_path_name,
+ 'destination': install_path_name.as_posix(),
'tag': data.tag or None,
'subproject': data.subproject or None,
}
@@ -162,7 +163,7 @@ def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[s
entry['exclude_files'] = list(exclude_files)
plan[data_type] = plan.get(data_type, {})
- plan[data_type][data.path] = entry
+ plan[data_type][data_path] = entry
return plan