Skip to content

Commit f605382

Browse files
committed
Change tools/utils/sourceList.py to always output posix paths.
Fixes the script so that it always outputs paths with forward slashes even on Windows when using a Windows native Python build instead of the msys2/cygwin one. Forward slash paths are needed because this is the form qmake/cmake uses internally and is what is expected when they call this build script.
1 parent a1c13cf commit f605382

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/utils/sourceList.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from xml.etree import ElementTree
22
import os
33
import sys
4-
4+
from pathlib import PurePath
55

66
def list_typesystem_cpp_sources(typesystem, out):
77
tree = ElementTree.parse(typesystem)
@@ -15,7 +15,10 @@ def list_typesystem_cpp_sources(typesystem, out):
1515
sources = [f"{package.lower()}_module_wrapper.cpp"]
1616
sources.extend([f"{typename.lower()}_wrapper.cpp" for typename in types])
1717

18-
return [os.path.normpath(os.path.join(out, package, f)) for f in sources]
18+
# Return normalized paths that can be consumed by cmake/qmake.
19+
# These paths must be in posix form (i.e. have forward slashes) since that
20+
# is what cmake/qmake uses internally.
21+
return [PurePath(os.path.normpath(os.path.join(out, package, f))).as_posix() for f in sources]
1922

2023

2124
if __name__ == "__main__":

0 commit comments

Comments
 (0)