Skip to content

Commit d9b9885

Browse files
nirbheekeli-schwartz
authored andcommitted
qt dependency: Don't insert backslashes into cflags on windows
The use of os.path.join is inserting `\` into the compile_args, which is wrong since qmake outputs `/` even on Windows, and in fact it causes pkgconfig files that depend on qmake dependencies to have `\` path separators, which get resolved as escape sequences. Use Path.as_posix() to avoid this. (cherry picked from commit 9ca2764)
1 parent 8c97348 commit d9b9885

File tree

1 file changed

+3
-2
lines changed
  • mesonbuild/dependencies

1 file changed

+3
-2
lines changed

mesonbuild/dependencies/qt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import abc
1010
import re
1111
import os
12+
from pathlib import Path
1213
import typing as T
1314

1415
from .base import DependencyException, DependencyMethods
@@ -50,7 +51,7 @@ def _qt_get_private_includes(mod_inc_dir: str, module: str, mod_version: str) ->
5051
if len(dirname.split('.')) == 3:
5152
private_dir = dirname
5253
break
53-
return [private_dir, os.path.join(private_dir, 'Qt' + module)]
54+
return [private_dir, Path(private_dir, f'Qt{module}').as_posix()]
5455

5556

5657
def get_qmake_host_bins(qvars: T.Dict[str, str]) -> str:
@@ -303,7 +304,7 @@ def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]):
303304
modules_lib_suffix = _get_modules_lib_suffix(self.version, self.env.machines[self.for_machine], is_debug)
304305

305306
for module in self.requested_modules:
306-
mincdir = os.path.join(incdir, 'Qt' + module)
307+
mincdir = Path(incdir, f'Qt{module}').as_posix()
307308
self.compile_args.append('-I' + mincdir)
308309

309310
if module == 'QuickTest':

0 commit comments

Comments
 (0)