Skip to content

Commit

Permalink
tools: fix GYP ninja generator for Python 3
Browse files Browse the repository at this point in the history
PR-URL: #29416
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
targos committed Sep 20, 2019
1 parent 010d29d commit 2f81d59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/gyp/pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def WriteCollapsedDependencies(self, name, targets, order_only=None):
Uses a stamp file if necessary."""

assert targets == filter(None, targets), targets
assert targets == [item for item in targets if item], targets
if len(targets) == 0:
assert not order_only
return None
Expand Down Expand Up @@ -432,8 +432,8 @@ def WriteSpec(self, spec, config_name, generator_flags):
compile_depends.append(target.PreCompileInput())
if target.uses_cpp:
self.target.uses_cpp = True
actions_depends = filter(None, actions_depends)
compile_depends = filter(None, compile_depends)
actions_depends = [item for item in actions_depends if item]
compile_depends = [item for item in compile_depends if item]
actions_depends = self.WriteCollapsedDependencies('actions_depends',
actions_depends)
compile_depends = self.WriteCollapsedDependencies('compile_depends',
Expand Down Expand Up @@ -2381,6 +2381,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,

qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name,
toolset)
qualified_target_for_hash = qualified_target_for_hash.encode('utf-8')
hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest()

base_path = os.path.dirname(build_file)
Expand Down

0 comments on commit 2f81d59

Please sign in to comment.