Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f25760c

Browse filesBrowse files
segevfinermarco-ippolito
authored andcommitted
build: add the option to generate compile_commands.json in vcbuild.bat
Refs: nodejs/gyp-next#238 PR-URL: #52279 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ae4b2ae commit f25760c
Copy full SHA for f25760c

File tree

Expand file treeCollapse file tree

2 files changed

+9
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-2
lines changed
Open diff view settings
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,8 +2249,9 @@ def make_bin_override():
22492249

22502250
if options.compile_commands_json:
22512251
gyp_args += ['-f', 'compile_commands_json']
2252-
os.path.islink('./compile_commands.json') and os.unlink('./compile_commands.json')
2253-
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
2252+
if sys.platform != 'win32':
2253+
os.path.lexists('./compile_commands.json') and os.unlink('./compile_commands.json')
2254+
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
22542255

22552256
# pass the leftover non-whitespace positional arguments to GYP
22562257
gyp_args += [arg for arg in args if not str.isspace(arg)]
@@ -2260,4 +2261,7 @@ def make_bin_override():
22602261

22612262
print_verbose("running: \n " + " ".join(['python', 'tools/gyp_node.py'] + gyp_args))
22622263
run_gyp(gyp_args)
2264+
if options.compile_commands_json and sys.platform == 'win32':
2265+
os.path.isfile('./compile_commands.json') and os.unlink('./compile_commands.json')
2266+
shutil.copy2('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
22632267
info('configure completed successfully')
Collapse file

‎vcbuild.bat‎

Copy file name to clipboardExpand all lines: vcbuild.bat
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ set openssl_no_asm=
6666
set no_shared_roheap=
6767
set doc=
6868
set extra_msbuild_args=
69+
set compile_commands=
6970
set exit_code=0
7071

7172
:next-arg
@@ -140,6 +141,7 @@ if /i "%1"=="openssl-no-asm" set openssl_no_asm=1&goto arg-ok
140141
if /i "%1"=="no-shared-roheap" set no_shared_roheap=1&goto arg-ok
141142
if /i "%1"=="doc" set doc=1&goto arg-ok
142143
if /i "%1"=="binlog" set extra_msbuild_args=/binaryLogger:out\%config%\node.binlog&goto arg-ok
144+
if /i "%1"=="compile-commands" set compile_commands=1&goto arg-ok
143145

144146
echo Error: invalid command line option `%1`.
145147
exit /b 1
@@ -196,6 +198,7 @@ if defined debug_nghttp2 set configure_flags=%configure_flags% --debug-nghttp
196198
if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm
197199
if defined no_shared_roheap set configure_flags=%configure_flags% --disable-shared-readonly-heap
198200
if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
201+
if defined compile_commands set configure_flags=%configure_flags% -C
199202
if "%target_arch%"=="x86" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set configure_flags=%configure_flags% --no-cross-compiling
200203

201204
if not exist "%~dp0deps\icu" goto no-depsicu

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.