Skip to content

Commit 35ffeb1

Browse files
meixgcclauss
andauthored
fix: use generator_output as output_dir (#191)
* 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 <[email protected]> * Update compile_commands_json.py --------- Co-authored-by: Christian Clauss <[email protected]>
1 parent 7a1a462 commit 35ffeb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pylib/gyp/generator/compile_commands_json.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ def GenerateOutput(target_list, target_dicts, data, params):
108108
cwd = os.path.dirname(build_file)
109109
AddCommandsForTarget(cwd, target, params, per_config_commands)
110110

111-
output_dir = params["generator_flags"].get("output_dir", "out")
111+
try:
112+
output_dir = params["options"].generator_output
113+
except (AttributeError, KeyError):
114+
output_dir = params["generator_flags"].get("output_dir", "out")
112115
for configuration_name, commands in per_config_commands.items():
113116
filename = os.path.join(output_dir, configuration_name, "compile_commands.json")
114117
gyp.common.EnsureDirExists(filename)

0 commit comments

Comments
 (0)