Skip to content

Commit

Permalink
fix: use generator_output as output_dir (#191)
Browse files Browse the repository at this point in the history
* fix: use generator_output as output_dir

fix: nodejs/node-gyp#2305

* Update pylib/gyp/generator/compile_commands_json.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update compile_commands_json.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
meixg and cclauss authored May 30, 2023
1 parent 7a1a462 commit 35ffeb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pylib/gyp/generator/compile_commands_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ def GenerateOutput(target_list, target_dicts, data, params):
cwd = os.path.dirname(build_file)
AddCommandsForTarget(cwd, target, params, per_config_commands)

output_dir = params["generator_flags"].get("output_dir", "out")
try:
output_dir = params["options"].generator_output
except (AttributeError, KeyError):
output_dir = params["generator_flags"].get("output_dir", "out")
for configuration_name, commands in per_config_commands.items():
filename = os.path.join(output_dir, configuration_name, "compile_commands.json")
gyp.common.EnsureDirExists(filename)
Expand Down

0 comments on commit 35ffeb1

Please sign in to comment.