Skip to content

Commit f538c16

Browse files
committed
fix: fix no commands in compile_commands.json file when using objc files
1 parent 7d883b5 commit f538c16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gyp/pylib/gyp/generator/compile_commands_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def AddCommandsForTarget(cwd, target, params, per_config_commands):
6262
defines = ["-D" + s for s in defines]
6363

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

6868
def resolve(filename):
@@ -81,7 +81,7 @@ def resolve(filename):
8181
commands = per_config_commands.setdefault(configuration_name, [])
8282
for source in sources:
8383
file = resolve(source)
84-
isc = source.endswith(".c")
84+
isc = source.endswith((".c", ".m"))
8585
cc = "cc" if isc else "c++"
8686
cflags = cflags_c if isc else cflags_cc
8787
command = " ".join(

0 commit comments

Comments
 (0)