Revert "backends: Use POSIX paths for target paths"

This reverts commit 12563f74a9f3dda70dcd4778aa958de355d1fae7.
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index e3d6c60..2344764 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -150,7 +150,7 @@
     def __post_init__(self, outdir_name: T.Optional[str]) -> None:
         if outdir_name is None:
             outdir_name = os.path.join('{prefix}', self.outdir)
-        self.out_name = Path(outdir_name, os.path.basename(self.fname)).as_posix()
+        self.out_name = os.path.join(outdir_name, os.path.basename(self.fname))
 
 @dataclass(eq=False)
 class InstallEmptyDir:
@@ -307,16 +307,16 @@
         else:
             assert isinstance(t, build.BuildTarget), t
             filename = t.get_filename()
-        return Path(self.get_target_dir(t), filename).as_posix()
+        return os.path.join(self.get_target_dir(t), filename)
 
     def get_target_filename_abs(self, target: T.Union[build.Target, build.CustomTargetIndex]) -> str:
-        return Path(self.environment.get_build_dir(), self.get_target_filename(target)).as_posix()
+        return os.path.join(self.environment.get_build_dir(), self.get_target_filename(target))
 
     def get_target_debug_filename(self, target: build.BuildTarget) -> T.Optional[str]:
         assert isinstance(target, build.BuildTarget), target
         if target.get_debug_filename():
             debug_filename = target.get_debug_filename()
-            return Path(self.get_target_dir(target), debug_filename).as_posix()
+            return os.path.join(self.get_target_dir(target), debug_filename)
         else:
             return None
 
@@ -324,7 +324,7 @@
         assert isinstance(target, build.BuildTarget), target
         if not target.get_debug_filename():
             return None
-        return Path(self.environment.get_build_dir(), self.get_target_debug_filename(target)).as_posix()
+        return os.path.join(self.environment.get_build_dir(), self.get_target_debug_filename(target))
 
     def get_source_dir_include_args(self, target: build.BuildTarget, compiler: 'Compiler', *, absolute_path: bool = False) -> T.List[str]:
         curdir = target.get_subdir()
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 595a27a..55f9d27 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -3389,7 +3389,7 @@
     def get_target_shsym_filename(self, target):
         # Always name the .symbols file after the primary build output because it always exists
         targetdir = self.get_target_private_dir(target)
-        return Path(targetdir, target.get_filename() + '.symbols').as_posix()
+        return os.path.join(targetdir, target.get_filename() + '.symbols')
 
     def generate_shsym(self, target) -> None:
         target_file = self.get_target_filename(target)
@@ -3408,7 +3408,7 @@
         self.add_build(elem)
 
     def get_import_filename(self, target) -> str:
-        return Path(self.get_target_dir(target), target.import_filename).as_posix()
+        return os.path.join(self.get_target_dir(target), target.import_filename)
 
     def get_target_type_link_args(self, target, linker):
         commands = []
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index e19e528..9f7eb33 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -128,7 +128,7 @@
 def list_install_plan(installdata: backends.InstallData) -> T.Dict[str, T.Dict[str, T.Dict[str, T.Union[str, T.List[str], None]]]]:
     plan: T.Dict[str, T.Dict[str, T.Dict[str, T.Union[str, T.List[str], None]]]] = {
         'targets': {
-            Path(installdata.build_dir, target.fname).as_posix(): {
+            os.path.join(installdata.build_dir, target.fname): {
                 'destination': target.out_name,
                 'tag': target.tag or None,
                 'subproject': target.subproject or None,
@@ -146,14 +146,13 @@
     }.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 = Path(data.install_path_name)
+            install_path_name = data.install_path_name
             if key == 'headers':  # in the headers, install_path_name is the directory
-                install_path_name = install_path_name / os.path.basename(data.path)
+                install_path_name = os.path.join(install_path_name, os.path.basename(data.path))
 
             entry = {
-                'destination': install_path_name.as_posix(),
+                'destination': install_path_name,
                 'tag': data.tag or None,
                 'subproject': data.subproject or None,
             }
@@ -164,7 +163,7 @@
                 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
 
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index f158be7..b2874cf 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -4812,144 +4812,143 @@
         shared_lib_name = lambda name: output_name(name, SharedLibrary)
         static_lib_name = lambda name: output_name(name, StaticLibrary)
         exe_name = lambda name: output_name(name, Executable)
-        get_path = lambda f: Path(f).as_posix()
 
         expected = {
             'targets': {
-                get_path(f'{self.builddir}/out1-notag.txt'): {
+                f'{self.builddir}/out1-notag.txt': {>
                     'build_rpaths': [],
                     'destination': '{datadir}/out1-notag.txt',
                     'install_rpath': None,
                     'tag': None,
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/out2-notag.txt'): {
+                f'{self.builddir}/out2-notag.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out2-notag.txt',
                     'install_rpath': None,
                     'tag': None,
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/libstatic.a'): {
+                f'{self.builddir}/libstatic.a': {
                     'build_rpaths': [],
                     'destination': '{libdir_static}/libstatic.a',
                     'install_rpath': None,
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + exe_name('app')): {
+                f'{self.builddir}/' + exe_name('app'): {
                     'build_rpaths': [],
                     'destination': '{bindir}/' + exe_name('app'),
                     'install_rpath': None,
                     'tag': 'runtime',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + exe_name('app-otherdir')): {
+                f'{self.builddir}/' + exe_name('app-otherdir'): {
                     'build_rpaths': [],
                     'destination': '{prefix}/otherbin/' + exe_name('app-otherdir'),
                     'install_rpath': None,
                     'tag': 'runtime',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/subdir/' + exe_name('app2')): {
+                f'{self.builddir}/subdir/' + exe_name('app2'): {
                     'build_rpaths': [],
                     'destination': '{bindir}/' + exe_name('app2'),
                     'install_rpath': None,
                     'tag': 'runtime',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + shared_lib_name('shared')): {
+                f'{self.builddir}/' + shared_lib_name('shared'): {
                     'build_rpaths': [],
                     'destination': '{libdir_shared}/' + shared_lib_name('shared'),
                     'install_rpath': None,
                     'tag': 'runtime',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + shared_lib_name('both')): {
+                f'{self.builddir}/' + shared_lib_name('both'): {
                     'build_rpaths': [],
                     'destination': '{libdir_shared}/' + shared_lib_name('both'),
                     'install_rpath': None,
                     'tag': 'runtime',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + static_lib_name('both')): {
+                f'{self.builddir}/' + static_lib_name('both'): {
                     'build_rpaths': [],
                     'destination': '{libdir_static}/' + static_lib_name('both'),
                     'install_rpath': None,
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + shared_lib_name('bothcustom')): {
+                f'{self.builddir}/' + shared_lib_name('bothcustom'): {
                     'build_rpaths': [],
                     'destination': '{libdir_shared}/' + shared_lib_name('bothcustom'),
                     'install_rpath': None,
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/' + static_lib_name('bothcustom')): {
+                f'{self.builddir}/' + static_lib_name('bothcustom'): {
                     'build_rpaths': [],
                     'destination': '{libdir_static}/' + static_lib_name('bothcustom'),
                     'install_rpath': None,
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/subdir/' + shared_lib_name('both2')): {
+                f'{self.builddir}/subdir/' + shared_lib_name('both2'): {
                     'build_rpaths': [],
                     'destination': '{libdir_shared}/' + shared_lib_name('both2'),
                     'install_rpath': None,
                     'tag': 'runtime',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/subdir/' + static_lib_name('both2')): {
+                f'{self.builddir}/subdir/' + static_lib_name('both2'): {
                     'build_rpaths': [],
                     'destination': '{libdir_static}/' + static_lib_name('both2'),
                     'install_rpath': None,
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/out1-custom.txt'): {
+                f'{self.builddir}/out1-custom.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out1-custom.txt',
                     'install_rpath': None,
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/out2-custom.txt'): {
+                f'{self.builddir}/out2-custom.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out2-custom.txt',
                     'install_rpath': None,
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/out3-custom.txt'): {
+                f'{self.builddir}/out3-custom.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out3-custom.txt',
                     'install_rpath': None,
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/subdir/out1.txt'): {
+                f'{self.builddir}/subdir/out1.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out1.txt',
                     'install_rpath': None,
                     'tag': None,
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/subdir/out2.txt'): {
+                f'{self.builddir}/subdir/out2.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out2.txt',
                     'install_rpath': None,
                     'tag': None,
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/out-devel.h'): {
+                f'{self.builddir}/out-devel.h': {
                     'build_rpaths': [],
                     'destination': '{includedir}/out-devel.h',
                     'install_rpath': None,
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/out3-notag.txt'): {
+                f'{self.builddir}/out3-notag.txt': {
                     'build_rpaths': [],
                     'destination': '{datadir}/out3-notag.txt',
                     'install_rpath': None,
@@ -4958,80 +4957,80 @@
                 },
             },
             'configure': {
-                get_path(f'{self.builddir}/foo-notag.h'): {
+                f'{self.builddir}/foo-notag.h': {
                     'destination': '{datadir}/foo-notag.h',
                     'tag': None,
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/foo2-devel.h'): {
+                f'{self.builddir}/foo2-devel.h': {
                     'destination': '{includedir}/foo2-devel.h',
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/foo-custom.h'): {
+                f'{self.builddir}/foo-custom.h': {
                     'destination': '{datadir}/foo-custom.h',
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{self.builddir}/subdir/foo2.h'): {
+                f'{self.builddir}/subdir/foo2.h': {
                     'destination': '{datadir}/foo2.h',
                     'tag': None,
                     'subproject': None,
                 },
             },
             'data': {
-                get_path(f'{testdir}/bar-notag.txt'): {
+                f'{testdir}/bar-notag.txt': {
                     'destination': '{datadir}/bar-notag.txt',
                     'tag': None,
                     'subproject': None,
                 },
-                get_path(f'{testdir}/bar-devel.h'): {
+                f'{testdir}/bar-devel.h': {
                     'destination': '{includedir}/bar-devel.h',
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{testdir}/bar-custom.txt'): {
+                f'{testdir}/bar-custom.txt': {
                     'destination': '{datadir}/bar-custom.txt',
                     'tag': 'custom',
                     'subproject': None,
                 },
-                get_path(f'{testdir}/subdir/bar2-devel.h'): {
+                f'{testdir}/subdir/bar2-devel.h': {
                     'destination': '{includedir}/bar2-devel.h',
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{testdir}/subprojects/subproject/aaa.txt'): {
+                f'{testdir}/subprojects/subproject/aaa.txt': {
                     'destination': '{datadir}/subproject/aaa.txt',
                     'tag': None,
                     'subproject': 'subproject',
                 },
-                get_path(f'{testdir}/subprojects/subproject/bbb.txt'): {
+                f'{testdir}/subprojects/subproject/bbb.txt': {
                     'destination': '{datadir}/subproject/bbb.txt',
                     'tag': 'data',
                     'subproject': 'subproject',
                 },
             },
             'headers': {
-                get_path(f'{testdir}/foo1-devel.h'): {
+                f'{testdir}/foo1-devel.h': {
                     'destination': '{includedir}/foo1-devel.h',
                     'tag': 'devel',
                     'subproject': None,
                 },
-                get_path(f'{testdir}/subdir/foo3-devel.h'): {
+                f'{testdir}/subdir/foo3-devel.h': {
                     'destination': '{includedir}/foo3-devel.h',
                     'tag': 'devel',
                     'subproject': None,
                 },
             },
             'install_subdirs': {
-                get_path(f'{testdir}/custom_files'): {
+                f'{testdir}/custom_files': {
                     'destination': '{datadir}/custom_files',
                     'tag': 'custom',
                     'subproject': None,
                     'exclude_dirs': [],
                     'exclude_files': [],
                 },
-                get_path(f'{testdir}/excludes'): {
+                f'{testdir}/excludes': {
                     'destination': '{datadir}/excludes',
                     'tag': 'custom',
                     'subproject': None,
@@ -5041,10 +5040,11 @@
             }
         }
 
+        fix_path = lambda path: os.path.sep.join(path.split('/'))
         expected_fixed = {
             data_type: {
-                get_path(source): {
-                    key: get_path(value) if key == 'destination' else value
+                fix_path(source): {
+                    key: fix_path(value) if key == 'destination' else value
                     for key, value in attributes.items()
                 }
                 for source, attributes in files.items()
@@ -5055,7 +5055,6 @@
         for data_type, files in expected_fixed.items():
             for file, details in files.items():
                 with self.subTest(key='{}.{}'.format(data_type, file)):
-                    if data_type == 'data': print(res[data_type])
                     self.assertEqual(res[data_type][file], details)
 
     @skip_if_not_language('rust')