@@ -31,6 +31,8 @@ file a new issue.
31
31
* [ Building a debug build] ( #building-a-debug-build )
32
32
* [ Building an ASan build] ( #building-an-asan-build )
33
33
* [ Speeding up frequent rebuilds when developing] ( #speeding-up-frequent-rebuilds-when-developing )
34
+ * [ ccache] ( #ccache )
35
+ * [ Loading JS files from disk instead of embedding] ( #loading-js-files-from-disk-instead-of-embedding )
34
36
* [ Troubleshooting Unix and macOS builds] ( #troubleshooting-unix-and-macos-builds )
35
37
* [ Windows] ( #windows )
36
38
* [ Windows Prerequisites] ( #windows-prerequisites )
@@ -543,6 +545,8 @@ make test-only
543
545
544
546
#### Speeding up frequent rebuilds when developing
545
547
548
+ ##### ccache
549
+
546
550
Tips: The ` ccache ` utility is widely used and should generally work fine.
547
551
If you encounter any difficulties, consider disabling ` mold ` as a
548
552
troubleshooting step.
@@ -578,17 +582,26 @@ export CXX="ccache c++" # add to ~/.zshrc or other shell config file
578
582
579
583
On Windows:
580
584
581
- Tips: follow < https://github.com/ccache/ccache/wiki/MS-Visual-Studio > , and you
582
- should notice that obj file will be bigger the normal one.
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.
583
587
584
- First, install ccache, assume ccache install to c:\ccache, copy
585
- c:\ccache\ccache.exe to c:\ccache\cl.exe with this command
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.
586
591
587
592
``` powershell
588
593
cp c:\ccache\ccache.exe c:\ccache\cl.exe
589
594
```
590
595
591
- When building Node.js provide a path to your ccache via the option
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:
592
605
593
606
``` powershell
594
607
.\vcbuild.bat ccache c:\ccache\
@@ -597,6 +610,14 @@ When building Node.js provide a path to your ccache via the option
597
610
This will allow for near-instantaneous rebuilds when switching branches back
598
611
and forth that were built with cache.
599
612
613
+ To use it with ClangCL, run this instead:
614
+
615
+ ``` powershell
616
+ .\vcbuild.bat clang-cl ccache c:\ccache\
617
+ ```
618
+
619
+ ##### Loading JS files from disk instead of embedding
620
+
600
621
When modifying only the JS layer in ` lib ` , it is possible to externally load it
601
622
without modifying the executable:
602
623
@@ -681,14 +702,19 @@ Optional requirements for compiling for Windows on ARM (ARM64):
681
702
* Visual C++ ATL for ARM64
682
703
* Windows 10 SDK 10.0.17763.0 or newer
683
704
684
- Optional requirements for compiling with ClangCL:
705
+ Optional requirements for compiling with ClangCL (search for ` clang ` in Visual Studio
706
+ Installer's "individual component" tab):
685
707
686
- * Visual Studio optional components
708
+ * Visual Studio individual components
687
709
* C++ Clang Compiler for Windows
688
710
* MSBuild support for LLVM toolset
689
711
690
712
NOTE: Currently we only support compiling with Clang that comes from Visual Studio.
691
713
714
+ When building with ClangCL, if the output from ` vcbuild.bat ` shows that the components are not installed
715
+ even when the Visual Studio Installer shows that they are installed, try removing the components
716
+ first and then reinstalling them again.
717
+
692
718
##### Option 2: Automated install with WinGet
693
719
694
720
[ WinGet configuration files] ( https://github.com/nodejs/node/tree/main/.configurations )
0 commit comments