Skip to content

Commit 5fc1e27

Browse files
bzozMylesBorins
authored andcommitted
build, win: faster Release rebuilds
Sets Link Time Code Generation to INCREMENTAL improving Release rebuilds speed. Adds no-cctest option to vcbuild.bat, which will skip building cctest.exe PR-URL: #17393 Reviewed-By: Refael Ackermann <[email protected]>
1 parent 50f120e commit 5fc1e27

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

common.gypi

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@
186186
],
187187
},
188188
'VCLinkerTool': {
189-
'LinkTimeCodeGeneration': 1, # link-time code generation
190189
'OptimizeReferences': 2, # /OPT:REF
191190
'EnableCOMDATFolding': 2, # /OPT:ICF
192191
'LinkIncremental': 1, # disable incremental linking
192+
'AdditionalOptions': [
193+
'/LTCG:INCREMENTAL', # incremental link-time code generation
194+
],
193195
},
194196
},
195197
}

vcbuild.bat

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ set "common_test_suites=%js_test_suites% doctool addons addons-napi&set build_ad
5151
set http2_debug=
5252
set nghttp2_debug=
5353
set link_module=
54+
set no_cctest=
5455

5556
:next-arg
5657
if "%1"=="" goto args-done
@@ -115,6 +116,7 @@ if /i "%1"=="no-NODE-OPTIONS" set no_NODE_OPTIONS=1&goto arg-ok
115116
if /i "%1"=="debug-http2" set debug_http2=1&goto arg-ok
116117
if /i "%1"=="debug-nghttp2" set debug_nghttp2=1&goto arg-ok
117118
if /i "%1"=="link-module" set "link_module= --link-module=%2%link_module%"&goto arg-ok-2
119+
if /i "%1"=="no-cctest" set no_cctest=1&goto arg-ok
118120

119121
echo Error: invalid command line option `%1`.
120122
exit /b 1
@@ -275,6 +277,7 @@ set "msbcpu=/m:2"
275277
if "%NUMBER_OF_PROCESSORS%"=="1" set "msbcpu=/m:1"
276278
set "msbplatform=Win32"
277279
if "%target_arch%"=="x64" set "msbplatform=x64"
280+
if "%target%"=="Build" if defined no_cctest set target=node
278281
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
279282
if errorlevel 1 goto exit
280283
if "%target%" == "Clean" goto exit
@@ -472,8 +475,10 @@ if errorlevel 1 goto exit
472475
if "%test_args%"=="" goto test-v8
473476
if "%config%"=="Debug" set test_args=--mode=debug %test_args%
474477
if "%config%"=="Release" set test_args=--mode=release %test_args%
478+
if defined no_cctest echo Skipping cctest because no-cctest was specified && goto run-test-py
475479
echo running 'cctest %cctest_args%'
476480
"%config%\cctest" %cctest_args%
481+
:run-test-py
477482
call :run-python tools\test.py %test_args%
478483
goto test-v8
479484

@@ -550,7 +555,7 @@ echo Failed to create vc project files.
550555
goto exit
551556

552557
:help
553-
echo vcbuild.bat [debug/release] [msi] [test/test-ci/test-all/test-addons/test-addons-napi/test-internet/test-pummel/test-simple/test-message/test-gc/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [licensetf] [sign] [ia32/x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean]
558+
echo vcbuild.bat [debug/release] [msi] [test/test-ci/test-all/test-addons/test-addons-napi/test-internet/test-pummel/test-simple/test-message/test-gc/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [licensetf] [sign] [ia32/x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest]
554559
echo Examples:
555560
echo vcbuild.bat : builds release build
556561
echo vcbuild.bat debug : builds debug build
@@ -560,6 +565,7 @@ echo vcbuild.bat build-release : builds the release distribution as
560565
echo vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript
561566
echo vcbuild.bat link-module my_module.js : bundles my_module as built-in module
562567
echo vcbuild.bat lint : runs the C++ and JavaScript linter
568+
echo vcbuild.bat no-cctest : skip building cctest.exe
563569
goto exit
564570

565571
:run-python

0 commit comments

Comments
 (0)