mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
build: add the option to generate compile_commands.json in vcbuild.bat
Refs: https://github.com/nodejs/gyp-next/pull/238 PR-URL: https://github.com/nodejs/node/pull/52279 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
6a52e81260
commit
beb1892036
2 changed files with 9 additions and 2 deletions
|
@ -2310,8 +2310,9 @@ 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')
|
||||
if sys.platform != 'win32':
|
||||
os.path.lexists('./compile_commands.json') and os.unlink('./compile_commands.json')
|
||||
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
|
||||
|
||||
# pass the leftover non-whitespace positional arguments to GYP
|
||||
gyp_args += [arg for arg in args if not str.isspace(arg)]
|
||||
|
@ -2321,4 +2322,7 @@ if warn.warned and not options.verbose:
|
|||
|
||||
print_verbose("running: \n " + " ".join(['python', 'tools/gyp_node.py'] + gyp_args))
|
||||
run_gyp(gyp_args)
|
||||
if options.compile_commands_json and sys.platform == 'win32':
|
||||
os.path.isfile('./compile_commands.json') and os.unlink('./compile_commands.json')
|
||||
shutil.copy2('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
|
||||
info('configure completed successfully')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue