Skip to content

Commit

Permalink
build, win: faster Release rebuilds
Browse files Browse the repository at this point in the history
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 <refack@gmail.com>
  • Loading branch information
bzoz authored and MylesBorins committed Dec 12, 2017
1 parent 50f120e commit 5fc1e27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@
],
},
'VCLinkerTool': {
'LinkTimeCodeGeneration': 1, # link-time code generation
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
'LinkIncremental': 1, # disable incremental linking
'AdditionalOptions': [
'/LTCG:INCREMENTAL', # incremental link-time code generation
],
},
},
}
Expand Down
8 changes: 7 additions & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ set "common_test_suites=%js_test_suites% doctool addons addons-napi&set build_ad
set http2_debug=
set nghttp2_debug=
set link_module=
set no_cctest=

:next-arg
if "%1"=="" goto args-done
Expand Down Expand Up @@ -115,6 +116,7 @@ if /i "%1"=="no-NODE-OPTIONS" set no_NODE_OPTIONS=1&goto arg-ok
if /i "%1"=="debug-http2" set debug_http2=1&goto arg-ok
if /i "%1"=="debug-nghttp2" set debug_nghttp2=1&goto arg-ok
if /i "%1"=="link-module" set "link_module= --link-module=%2%link_module%"&goto arg-ok-2
if /i "%1"=="no-cctest" set no_cctest=1&goto arg-ok

echo Error: invalid command line option `%1`.
exit /b 1
Expand Down Expand Up @@ -275,6 +277,7 @@ set "msbcpu=/m:2"
if "%NUMBER_OF_PROCESSORS%"=="1" set "msbcpu=/m:1"
set "msbplatform=Win32"
if "%target_arch%"=="x64" set "msbplatform=x64"
if "%target%"=="Build" if defined no_cctest set target=node
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
if "%target%" == "Clean" goto exit
Expand Down Expand Up @@ -472,8 +475,10 @@ if errorlevel 1 goto exit
if "%test_args%"=="" goto test-v8
if "%config%"=="Debug" set test_args=--mode=debug %test_args%
if "%config%"=="Release" set test_args=--mode=release %test_args%
if defined no_cctest echo Skipping cctest because no-cctest was specified && goto run-test-py
echo running 'cctest %cctest_args%'
"%config%\cctest" %cctest_args%
:run-test-py
call :run-python tools\test.py %test_args%
goto test-v8

Expand Down Expand Up @@ -550,7 +555,7 @@ echo Failed to create vc project files.
goto exit

:help
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]
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]
echo Examples:
echo vcbuild.bat : builds release build
echo vcbuild.bat debug : builds debug build
Expand All @@ -560,6 +565,7 @@ echo vcbuild.bat build-release : builds the release distribution as
echo vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript
echo vcbuild.bat link-module my_module.js : bundles my_module as built-in module
echo vcbuild.bat lint : runs the C++ and JavaScript linter
echo vcbuild.bat no-cctest : skip building cctest.exe
goto exit

:run-python
Expand Down

0 comments on commit 5fc1e27

Please sign in to comment.