◐ Shell
clean mode source ↗

build,win: enable ccache · nodejs/node@dfd3f43

@@ -28,6 +28,7 @@ set target_env=

2828

set noprojgen=

2929

set projgen=

3030

set clang_cl=

31+

set ccache_path=

3132

set nobuild=

3233

set sign=

3334

set nosnapshot=

@@ -87,6 +88,7 @@ if /i "%1"=="vs2022" set target_env=vs2022&goto arg-ok

8788

if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok

8889

if /i "%1"=="projgen" set projgen=1&goto arg-ok

8990

if /i "%1"=="clang-cl" set clang_cl=1&goto arg-ok

91+

if /i "%1"=="ccache" set "ccache_path=%2%"&goto arg-ok-2

9092

if /i "%1"=="nobuild" set nobuild=1&goto arg-ok

9193

if /i "%1"=="nosign" set "sign="&echo Note: vcbuild no longer signs by default. "nosign" is redundant.&goto arg-ok

9294

if /i "%1"=="sign" set sign=1&goto arg-ok

@@ -206,6 +208,7 @@ if defined debug_nghttp2 set configure_flags=%configure_flags% --debug-nghttp

206208

if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm

207209

if defined no_shared_roheap set configure_flags=%configure_flags% --disable-shared-readonly-heap

208210

if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose

211+

if defined ccache_path set configure_flags=%configure_flags% --use-ccache-win

209212

if defined compile_commands set configure_flags=%configure_flags% -C

210213211214

if "%target_arch%"=="x86" (

@@ -364,6 +367,7 @@ if "%target%"=="Build" (

364367

if "%target%"=="node" if exist "%config%\cctest.exe" del "%config%\cctest.exe"

365368

if "%target%"=="node" if exist "%config%\embedtest.exe" del "%config%\embedtest.exe"

366369

if 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

368372

set UseMultiToolTask=True

369373

set EnforceProcessCountAcrossBuilds=True

@@ -800,7 +804,7 @@ set exit_code=1

800804

goto 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]

804808

echo Examples:

805809

echo vcbuild.bat : builds release build

806810

echo vcbuild.bat debug : builds debug build

@@ -811,6 +815,7 @@ echo vcbuild.bat enable-vtune : builds Node.js with Intel VTune pr

811815

echo vcbuild.bat link-module my_module.js : bundles my_module as built-in module

812816

echo vcbuild.bat lint : runs the C++, documentation and JavaScript linter

813817

echo vcbuild.bat no-cctest : skip building cctest.exe

818+

echo vcbuild.bat ccache c:\ccache\ : use ccache to speed build

814819

goto exit

815820816821

:exit