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 <soyjuanarbol@gmail.com>
PR-URL: #49260
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
juanarbol authored and targos committed Nov 26, 2023
1 parent 651e450 commit 075c57e
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 @@ -2169,6 +2169,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 075c57e

Please sign in to comment.