build,win: enable ccache · nodejs/node@dfd3f43
@@ -28,6 +28,7 @@ set target_env=
2828set noprojgen=
2929set projgen=
3030set clang_cl=
31+set ccache_path=
3132set nobuild=
3233set sign=
3334set nosnapshot=
@@ -87,6 +88,7 @@ if /i "%1"=="vs2022" set target_env=vs2022&goto arg-ok
8788if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
8889if /i "%1"=="projgen" set projgen=1&goto arg-ok
8990if /i "%1"=="clang-cl" set clang_cl=1&goto arg-ok
91+if /i "%1"=="ccache" set "ccache_path=%2%"&goto arg-ok-2
9092if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
9193if /i "%1"=="nosign" set "sign="&echo Note: vcbuild no longer signs by default. "nosign" is redundant.&goto arg-ok
9294if /i "%1"=="sign" set sign=1&goto arg-ok
@@ -206,6 +208,7 @@ if defined debug_nghttp2 set configure_flags=%configure_flags% --debug-nghttp
206208if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm
207209if defined no_shared_roheap set configure_flags=%configure_flags% --disable-shared-readonly-heap
208210if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
211+if defined ccache_path set configure_flags=%configure_flags% --use-ccache-win
209212if defined compile_commands set configure_flags=%configure_flags% -C
210213211214if "%target_arch%"=="x86" (
@@ -364,6 +367,7 @@ if "%target%"=="Build" (
364367if "%target%"=="node" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
365368if "%target%"=="node" if exist "%config%\embedtest.exe" del "%config%\embedtest.exe"
366369if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_args%"
370+if defined ccache_path set "extra_msbuild_args=%extra_msbuild_args% /p:TrackFileAccess=false /p:CLToolPath=%ccache_path% /p:ForceImportAfterCppProps=%CD%\tools\msvs\props_4_ccache.props"
367371@rem Setup env variables to use multiprocessor build
368372set UseMultiToolTask=True
369373set EnforceProcessCountAcrossBuilds=True
@@ -800,7 +804,7 @@ set exit_code=1
800804goto exit
801805802806:help
803-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] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [licensetf] [sign] [x64/arm64] [vs2022] [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]
807+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] [licensetf] [sign] [x64/arm64] [vs2022] [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]
804808echo Examples:
805809echo vcbuild.bat : builds release build
806810echo vcbuild.bat debug : builds debug build
@@ -811,6 +815,7 @@ echo vcbuild.bat enable-vtune : builds Node.js with Intel VTune pr
811815echo vcbuild.bat link-module my_module.js : bundles my_module as built-in module
812816echo vcbuild.bat lint : runs the C++, documentation and JavaScript linter
813817echo vcbuild.bat no-cctest : skip building cctest.exe
818+echo vcbuild.bat ccache c:\ccache\ : use ccache to speed build
814819goto exit
815820816821:exit