build: add symlink to compile_commands.json file if needed

Usually lsp servers needs the `compile_commands.json` file in the root
directory.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/49260
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Juan José authored and Ulises Gascón committed 2023-09-10 18:09:27 +00:00
1 parent b961d9bd52
commit cade5716df
1 file changed
+2
+2
View File
@@ -2116,6 +2116,8 @@ else:
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: