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 a929c71

Browse filesBrowse files
segevfinertargos
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 295f684 commit a929c71
Copy full SHA for a929c71

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
@@ -2307,8 +2307,9 @@ def make_bin_override():
23072307

23082308
if options.compile_commands_json:
23092309
gyp_args += ['-f', 'compile_commands_json']
2310-
os.path.islink('./compile_commands.json') and os.unlink('./compile_commands.json')
2311-
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
2310+
if sys.platform != 'win32':
2311+
os.path.lexists('./compile_commands.json') and os.unlink('./compile_commands.json')
2312+
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
23122313

23132314
# pass the leftover non-whitespace positional arguments to GYP
23142315
gyp_args += [arg for arg in args if not str.isspace(arg)]
@@ -2318,4 +2319,7 @@ def make_bin_override():
23182319

23192320
print_verbose("running: \n " + " ".join(['python', 'tools/gyp_node.py'] + gyp_args))
23202321
run_gyp(gyp_args)
2322+
if options.compile_commands_json and sys.platform == 'win32':
2323+
os.path.isfile('./compile_commands.json') and os.unlink('./compile_commands.json')
2324+
shutil.copy2('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')
23212325
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
@@ -70,6 +70,7 @@ set openssl_no_asm=
7070
set no_shared_roheap=
7171
set doc=
7272
set extra_msbuild_args=
73+
set compile_commands=
7374
set exit_code=0
7475

7576
:next-arg
@@ -147,6 +148,7 @@ if /i "%1"=="openssl-no-asm" set openssl_no_asm=1&goto arg-ok
147148
if /i "%1"=="no-shared-roheap" set no_shared_roheap=1&goto arg-ok
148149
if /i "%1"=="doc" set doc=1&goto arg-ok
149150
if /i "%1"=="binlog" set extra_msbuild_args=/binaryLogger:out\%config%\node.binlog&goto arg-ok
151+
if /i "%1"=="compile-commands" set compile_commands=1&goto arg-ok
150152

151153
echo Error: invalid command line option `%1`.
152154
exit /b 1
@@ -205,6 +207,7 @@ if defined debug_nghttp2 set configure_flags=%configure_flags% --debug-nghttp
205207
if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm
206208
if defined no_shared_roheap set configure_flags=%configure_flags% --disable-shared-readonly-heap
207209
if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
210+
if defined compile_commands set configure_flags=%configure_flags% -C
208211
if "%target_arch%"=="x86" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set configure_flags=%configure_flags% --no-cross-compiling
209212

210213
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.