@@ -26,6 +26,7 @@ set target_arch=x64
2626set ltcg =
2727set thin_lto =
2828set lto =
29+ set lto_jobs =
2930set pgo_generate =
3031set pgo_use =
3132set target_env =
@@ -105,6 +106,7 @@ if /i "%1"=="nocorepack" set nocorepack=1&goto arg-ok
105106if /i " %1 " == " ltcg" set ltcg = 1& goto arg-ok
106107if /i " %1 " == " thin-lto" set thin_lto = 1& goto arg-ok
107108if /i " %1 " == " lto" set lto = 1& goto arg-ok
109+ if /i " %1 " == " lto-jobs" set " lto_jobs = %2 " & goto arg-ok-2
108110if /i " %1 " == " pgo-generate" set pgo_generate = 1& goto arg-ok
109111if /i " %1 " == " pgo-use" set pgo_use = 1& goto arg-ok
110112if /i " %1 " == " v8windbg" set v8windbg = 1& goto arg-ok
@@ -175,6 +177,18 @@ goto next-arg
175177
176178:args-done
177179
180+ if defined build_release (
181+ set config = Release
182+ set package = 1
183+ set msi = 1
184+ set licensertf = 1
185+ set download_arg = " --download=all"
186+ set i18n_arg = full-icu
187+ set projgen = 1
188+ set cctest = 1
189+ set thin_lto = 1
190+ )
191+
178192:: LTO mutual exclusion
179193set lto_count = 0
180194if defined ltcg set /a lto_count += 1
@@ -196,18 +210,6 @@ if defined pgo_generate if defined pgo_use (
196210 exit /b 1
197211)
198212
199- if defined build_release (
200- set config = Release
201- set package = 1
202- set msi = 1
203- set licensertf = 1
204- set download_arg = " --download=all"
205- set i18n_arg = full-icu
206- set projgen = 1
207- set cctest = 1
208- set ltcg = 1
209- )
210-
211213if defined msi set stage_package = 1
212214if defined package set stage_package = 1
213215
@@ -231,6 +233,7 @@ if defined nocorepack set configure_flags=%configure_flags% --without-core
231233if defined ltcg set configure_flags = %configure_flags% --with-ltcg
232234if defined thin_lto set configure_flags = %configure_flags% --enable-thin-lto
233235if defined lto set configure_flags = %configure_flags% --enable-lto
236+ if defined lto_jobs set configure_flags = %configure_flags% --lto-jobs=%lto_jobs%
234237if defined pgo_generate set configure_flags = %configure_flags% --enable-pgo-generate
235238if defined pgo_use set configure_flags = %configure_flags% --enable-pgo-use
236239if defined release_urlbase set configure_flags = %configure_flags% --release-urlbase=%release_urlbase%
@@ -881,7 +884,7 @@ set exit_code=1
881884goto exit
882885
883886:help
884- echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-internet/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [clang-cl] [ccache path-to-ccache] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [thin-lto] [lto] [pgo-generate] [pgo-use] [licensetf] [sign] [x64/arm64] [vs2022/vs2026] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [format-md] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
887+ echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-internet/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [clang-cl] [ccache path-to-ccache] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [thin-lto] [lto] [lto-jobs number-of-jobs] [ pgo-generate] [pgo-use] [licensetf] [sign] [x64/arm64] [vs2022/vs2026] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [format-md] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
885888echo Examples:
886889echo vcbuild.bat : builds release build
887890echo vcbuild.bat debug : builds debug build
@@ -895,6 +898,7 @@ echo vcbuild.bat no-cctest : skip building cctest.exe
895898echo vcbuild.bat ccache c:\ccache\ : use ccache to speed build
896899echo vcbuild.bat thin-lto : builds with Thin LTO applied globally to all targets
897900echo vcbuild.bat lto : builds with Full LTO applied globally to all targets
901+ echo vcbuild.bat thin-lto lto-jobs 2 : builds with Thin LTO applied globally to all targets and limits parallel LTO link jobs (reduces peak memory usage)
898902echo vcbuild.bat pgo-generate : builds instrumented binary for PGO (profile first, then rebuild with pgo-use)
899903echo vcbuild.bat pgo-use : builds optimized binary using PGO profile data
900904goto exit
0 commit comments