Skip to content

Commit

Permalink
fix: do not rewrite absolute paths to avoid long paths (#74)
Browse files Browse the repository at this point in the history
This is an alternative to f2c7618.
  • Loading branch information
targos committed Oct 16, 2020
1 parent 3d50d22 commit c2ccc1a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pylib/gyp/generator/msvs.py
Expand Up @@ -3614,13 +3614,12 @@ def _AddSources2(
extension_to_rule_name,
_GetUniquePlatforms(spec),
)
if group == "compile":
# Always add an <ObjectFileName> value to support duplicate
# source file basenames.
if group == "compile" and not os.path.isabs(source):
# Add an <ObjectFileName> value to support duplicate source
# file basenames, except for absolute paths to avoid paths
# with more than 260 characters.
file_name = os.path.splitext(source)[0] + ".obj"
if os.path.isabs(file_name):
file_name = os.path.splitdrive(file_name)[1]
elif file_name.startswith("..\\"):
if file_name.startswith("..\\"):
file_name = re.sub(r"^(\.\.\\)+", "", file_name)
elif file_name.startswith("$("):
file_name = re.sub(r"^\$\([^)]+\)\\", "", file_name)
Expand Down

0 comments on commit c2ccc1a

Please sign in to comment.