Skip to content

Commit

Permalink
fix: compile_commands.json generation (#22)
Browse files Browse the repository at this point in the history
Add default fallback output directory.
  • Loading branch information
lundibundi authored Apr 3, 2020
1 parent 540a8a1 commit afa06c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pylib/gyp/generator/compile_commands_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def CalculateVariables(default_variables, params):


def AddCommandsForTarget(cwd, target, params, per_config_commands):
output_dir = params["generator_flags"]["output_dir"]
output_dir = params["generator_flags"].get("output_dir", "out")
for configuration_name, configuration in target["configurations"].items():
builddir_name = os.path.join(output_dir, configuration_name)

Expand Down Expand Up @@ -110,7 +110,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"]["output_dir"]
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 afa06c4

Please sign in to comment.