Skip to content

Commit

Permalink
build: add symlink to compile_commands.json file if needed
Browse files Browse the repository at this point in the history
Usually lsp servers needs the `compile_commands.json` file in the root
directory.

Signed-off-by: Juan José Arboleda <[email protected]>
PR-URL: #49260
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
  • Loading branch information
juanarbol authored and UlisesGascon committed Sep 10, 2023
1 parent b961d9b commit cade571
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2116,6 +2116,8 @@ def make_bin_override():

if options.compile_commands_json:
gyp_args += ['-f', 'compile_commands_json']
os.path.islink('./compile_commands.json') and os.unlink('./compile_commands.json')
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')

# override the variable `python` defined in common.gypi
if bin_override is not None:
Expand Down

0 comments on commit cade571

Please sign in to comment.