Skip to content

Commit 759f070

Browse files
stamphojobor
authored andcommitted
<tools/gyp> Prevent a python IOError on Windows
Task-number: QTBUG-46938 Change-Id: I09f518636d649c5149bdb0cd72881916639509db Reviewed-by: Kai Koehne <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
1 parent 1ee586d commit 759f070

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

chromium/tools/gyp/pylib/gyp/generator/ninja.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ def __init__(self, hash_for_rules, target_outputs, base_dir, build_dir,
250250
base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir)
251251
self.base_to_build = os.path.join(base_to_top, build_dir)
252252

253+
# Override relative paths and use absolute paths instead.
254+
# It is necessary to prevent python IOError on Windows due to long
255+
# relative paths while building QtWebEngine.
256+
self.build_to_base = os.path.join(toplevel_dir, base_dir)
257+
self.base_to_build = os.path.normpath(toplevel_build)
258+
253259
def ExpandSpecial(self, path, product_dir=None):
254260
"""Expand specials like $!PRODUCT_DIR in |path|.
255261

chromium/tools/gyp/pylib/gyp/msvs_emulation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ def GetLdflags(self, config, gyp_to_build_path, expand_special,
622622
ldflags.append('/NXCOMPAT')
623623

624624
have_def_file = filter(lambda x: x.startswith('/DEF:'), ldflags)
625+
build_dir = os.path.normpath(build_dir)
625626
manifest_flags, intermediate_manifest, manifest_files = \
626627
self._GetLdManifestFlags(config, manifest_base_name, gyp_to_build_path,
627628
is_executable and not have_def_file, build_dir)

0 commit comments

Comments
 (0)