Skip to content

Commit

Permalink
gyp: add missing extensions to compile_commands_json
Browse files Browse the repository at this point in the history
Extends compile_commands_json generator to consider more file extensions
than just c and cc. This commit adds the cpp and cxx extensiosn to the
list of input source files.
  • Loading branch information
manuel-arguelles authored and ryzokuken committed Aug 11, 2020
1 parent 49395fa commit 4815435
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pylib/gyp/generator/compile_commands_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def AddCommandsForTarget(cwd, target, params, per_config_commands):
defines = ["-D" + s for s in defines]

# TODO(bnoordhuis) Handle generated source files.
sources = target.get("sources", [])
sources = [s for s in sources if s.endswith(".c") or s.endswith(".cc")]
extensions = (".c", ".cc", ".cpp", ".cxx")
sources = [s for s in target.get("sources", []) if s.endswith(extensions)]

def resolve(filename):
return os.path.abspath(os.path.join(cwd, filename))
Expand Down

0 comments on commit 4815435

Please sign in to comment.