From 8845cfd8cf936389a2fe46b687ab20b025af2d6b Mon Sep 17 00:00:00 2001 From: meixuguang Date: Thu, 9 Mar 2023 16:53:21 +0800 Subject: [PATCH] fix: use generator_output as output_dir fix: https://github.com/nodejs/node-gyp/issues/2305 --- pylib/gyp/generator/compile_commands_json.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pylib/gyp/generator/compile_commands_json.py b/pylib/gyp/generator/compile_commands_json.py index d4541291..523bd553 100644 --- a/pylib/gyp/generator/compile_commands_json.py +++ b/pylib/gyp/generator/compile_commands_json.py @@ -42,7 +42,6 @@ def CalculateVariables(default_variables, params): def AddCommandsForTarget(cwd, target, params, per_config_commands): - output_dir = params["generator_flags"].get("output_dir", "out") for configuration_name, configuration in target["configurations"].items(): if IsMac(params): xcode_settings = gyp.xcode_emulation.XcodeSettings(target) @@ -93,7 +92,7 @@ def resolve(filename): gyp.common.EncodePOSIXShellArgument(file), ) ) - commands.append(dict(command=command, directory=output_dir, file=file)) + commands.append(dict(command=command, file=file)) def GenerateOutput(target_list, target_dicts, data, params): @@ -108,7 +107,7 @@ 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") + output_dir = params["options"].generator_output for configuration_name, commands in per_config_commands.items(): filename = os.path.join(output_dir, configuration_name, "compile_commands.json") gyp.common.EnsureDirExists(filename)