Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gyp/pylib/gyp/generator/compile_commands_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def AddCommandsForTarget(cwd, target, params, per_config_commands):
defines = ["-D" + s for s in defines]

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

def resolve(filename):
Expand All @@ -81,7 +81,7 @@ def resolve(filename):
commands = per_config_commands.setdefault(configuration_name, [])
for source in sources:
file = resolve(source)
isc = source.endswith(".c")
isc = source.endswith((".c", ".m"))
cc = "cc" if isc else "c++"
cflags = cflags_c if isc else cflags_cc
command = " ".join(
Expand Down
Loading