@@ -17,6 +17,7 @@ set target=Build |
17 | 17 | set target_arch=x64 |
18 | 18 | set target_env= |
19 | 19 | set noprojgen= |
| 20 | +set projgen= |
20 | 21 | set nobuild= |
21 | 22 | set sign= |
22 | 23 | set nosnapshot= |
@@ -67,6 +68,7 @@ if /i "%1"=="x86" set target_arch=x86&goto arg-ok |
67 | 68 | if /i "%1"=="x64" set target_arch=x64&goto arg-ok |
68 | 69 | if /i "%1"=="vs2017" set target_env=vs2017&goto arg-ok |
69 | 70 | if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok |
| 71 | +if /i "%1"=="projgen" set projgen=1&goto arg-ok |
70 | 72 | if /i "%1"=="nobuild" set nobuild=1&goto arg-ok |
71 | 73 | if /i "%1"=="nosign" set "sign="&echo Note: vcbuild no longer signs by default. "nosign" is redundant.&goto arg-ok |
72 | 74 | if /i "%1"=="sign" set sign=1&goto arg-ok |
@@ -147,6 +149,7 @@ if defined build_release ( |
147 | 149 | set licensertf=1 |
148 | 150 | set download_arg="--download=all" |
149 | 151 | set i18n_arg=small-icu |
| 152 | + set projgen=1 |
150 | 153 | ) |
151 | 154 |
|
152 | 155 | :: assign path to node_exe |
@@ -252,16 +255,36 @@ goto build-doc |
252 | 255 |
|
253 | 256 | :msbuild-found |
254 | 257 |
|
| 258 | +set project_generated= |
255 | 259 | :project-gen |
256 | 260 | @rem Skip project generation if requested. |
257 | 261 | if defined noprojgen goto msbuild |
258 | | - |
| 262 | +if defined projgen goto run-configure |
| 263 | +if not exist node.sln goto run-configure |
| 264 | +if not exist .gyp_configure_stamp goto run-configure |
| 265 | +echo %configure_flags% > .tmp_gyp_configure_stamp |
| 266 | +where /R . /T *.gyp? >> .tmp_gyp_configure_stamp |
| 267 | +fc .gyp_configure_stamp .tmp_gyp_configure_stamp >NUL 2>&1 |
| 268 | +if errorlevel 1 goto run-configure |
| 269 | + |
| 270 | +:skip-configure |
| 271 | +del .tmp_gyp_configure_stamp |
| 272 | +echo Reusing solution generated with %configure_flags% |
| 273 | +goto msbuild |
| 274 | + |
| 275 | +:run-configure |
| 276 | +del .tmp_gyp_configure_stamp |
| 277 | +del .gyp_configure_stamp |
259 | 278 | @rem Generate the VS project. |
260 | 279 | echo configure %configure_flags% |
| 280 | +echo %configure_flags%> .used_configure_flags |
261 | 281 | python configure %configure_flags% |
262 | 282 | if errorlevel 1 goto create-msvs-files-failed |
263 | 283 | if not exist node.sln goto create-msvs-files-failed |
| 284 | +set project_generated=1 |
264 | 285 | echo Project files generated. |
| 286 | +echo %configure_flags% > .gyp_configure_stamp |
| 287 | +where /R . /T *.gyp? >> .gyp_configure_stamp |
265 | 288 |
|
266 | 289 | :msbuild |
267 | 290 | @rem Skip build if requested. |
@@ -274,7 +297,10 @@ set "msbplatform=Win32" |
274 | 297 | if "%target_arch%"=="x64" set "msbplatform=x64" |
275 | 298 | if "%target%"=="Build" if defined no_cctest set target=node |
276 | 299 | msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo |
277 | | -if errorlevel 1 goto exit |
| 300 | +if errorlevel 1 ( |
| 301 | + if not defined project_generated echo Building Node with reused solution failed. To regenerate project files use "vcbuild projgen" |
| 302 | + goto exit |
| 303 | +) |
278 | 304 | if "%target%" == "Clean" goto exit |
279 | 305 |
|
280 | 306 | :sign |
@@ -626,10 +652,11 @@ goto exit |
626 | 652 |
|
627 | 653 | :create-msvs-files-failed |
628 | 654 | echo Failed to create vc project files. |
| 655 | +del .used_configure_flags |
629 | 656 | goto exit |
630 | 657 |
|
631 | 658 | :help |
632 | | -echo vcbuild.bat [debug/release] [msi] [doc] [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] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest] [openssl-no-asm] |
| 659 | +echo vcbuild.bat [debug/release] [msi] [doc] [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] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [noetw] [noperfctr] [licensetf] [sign] [ia32/x86/x64] [vs2017] [download-all] [enable-vtune] [lint/lint-ci/lint-js/lint-js-ci/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [no-cctest] [openssl-no-asm] |
633 | 660 | echo Examples: |
634 | 661 | echo vcbuild.bat : builds release build |
635 | 662 | echo vcbuild.bat debug : builds debug build |
|