Skip to content

Commit

Permalink
Fix compile_commands.json for MSVC (#238)
Browse files Browse the repository at this point in the history
* fix: compile_commands.json for MSVC

generator_output is None when trying to use that in Node.js via vcbuild.bat

* Review fix

* Update pylib/gyp/generator/compile_commands_json.py

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>

---------

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
segevfiner and anonrig authored Mar 30, 2024
1 parent 7e13b43 commit 4b95b2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pylib/gyp/generator/compile_commands_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def GenerateOutput(target_list, target_dicts, data, params):
AddCommandsForTarget(cwd, target, params, per_config_commands)

try:
output_dir = params["options"].generator_output
# generator_output can be `None` on Windows machines
output_dir = params["options"].generator_output or os.getcwd()
except (AttributeError, KeyError):
output_dir = params["generator_flags"].get("output_dir", "out")
for configuration_name, commands in per_config_commands.items():
Expand Down

0 comments on commit 4b95b2c

Please sign in to comment.