Skip to content

Commit 46c3e1e

Browse files
StefanStojanovicRafaelGSS
authored andcommitted
doc: fix Windows ccache section position
PR-URL: #57326 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d2ae6ae commit 46c3e1e

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

BUILDING.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ file a new issue.
4040
* [Option 2: Automated install with WinGet](#option-2-automated-install-with-winget)
4141
* [Option 3: Automated install with Boxstarter](#option-3-automated-install-with-boxstarter)
4242
* [Building Node.js](#building-nodejs-2)
43+
* [Using ccache](#using-ccache)
4344
* [Android](#android)
4445
* [`Intl` (ECMA-402) support](#intl-ecma-402-support)
4546
* [Build with full ICU support (all locales supported by ICU)](#build-with-full-icu-support-all-locales-supported-by-icu)
@@ -580,42 +581,6 @@ export CC="ccache cc" # add to ~/.zshrc or other shell config file
580581
export CXX="ccache c++" # add to ~/.zshrc or other shell config file
581582
```
582583

583-
On Windows:
584-
585-
Follow <https://github.com/ccache/ccache/wiki/MS-Visual-Studio>, and you
586-
should notice that obj file will be bigger than the normal one.
587-
588-
First, install ccache. Assuming the installation of ccache is in `c:\ccache`
589-
(where you can find `ccache.exe`), copy `c:\ccache\ccache.exe` to `c:\ccache\cl.exe`
590-
with this command.
591-
592-
```powershell
593-
cp c:\ccache\ccache.exe c:\ccache\cl.exe
594-
```
595-
596-
With newer version of Visual Studio, it may need the copy to be `clang-cl.exe`
597-
instead. If the output of `vcbuild.bat` suggestion missing `clang-cl.exe`, copy
598-
it differently:
599-
600-
```powershell
601-
cp c:\ccache\ccache.exe c:\ccache\clang-cl.exe
602-
```
603-
604-
When building Node.js, provide a path to your ccache via the option:
605-
606-
```powershell
607-
.\vcbuild.bat ccache c:\ccache\
608-
```
609-
610-
This will allow for near-instantaneous rebuilds when switching branches back
611-
and forth that were built with cache.
612-
613-
To use it with ClangCL, run this instead:
614-
615-
```powershell
616-
.\vcbuild.bat clang-cl ccache c:\ccache\
617-
```
618-
619584
##### Loading JS files from disk instead of embedding
620585

621586
When modifying only the JS layer in `lib`, it is possible to externally load it
@@ -813,6 +778,42 @@ To test if Node.js was built correctly:
813778
Release\node -e "console.log('Hello from Node.js', process.version)"
814779
```
815780

781+
##### Using ccache:
782+
783+
Follow <https://github.com/ccache/ccache/wiki/MS-Visual-Studio>, and you
784+
should notice that obj file will be bigger than the normal one.
785+
786+
First, install ccache. Assuming the installation of ccache is in `c:\ccache`
787+
(where you can find `ccache.exe`), copy `c:\ccache\ccache.exe` to `c:\ccache\cl.exe`
788+
with this command.
789+
790+
```powershell
791+
cp c:\ccache\ccache.exe c:\ccache\cl.exe
792+
```
793+
794+
With newer version of Visual Studio, it may need the copy to be `clang-cl.exe`
795+
instead. If the output of `vcbuild.bat` suggestion missing `clang-cl.exe`, copy
796+
it differently:
797+
798+
```powershell
799+
cp c:\ccache\ccache.exe c:\ccache\clang-cl.exe
800+
```
801+
802+
When building Node.js, provide a path to your ccache via the option:
803+
804+
```powershell
805+
.\vcbuild.bat ccache c:\ccache\
806+
```
807+
808+
This will allow for near-instantaneous rebuilds when switching branches back
809+
and forth that were built with cache.
810+
811+
To use it with ClangCL, run this instead:
812+
813+
```powershell
814+
.\vcbuild.bat clang-cl ccache c:\ccache\
815+
```
816+
816817
### Android
817818

818819
Android is not a supported platform. Patches to improve the Android build are

0 commit comments

Comments
 (0)