@@ -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 )
@@ -540,6 +542,8 @@ make test-only
540
542
541
543
#### Speeding up frequent rebuilds when developing
542
544
545
+ ##### ccache
546
+
543
547
Tips: The ` ccache ` utility is widely used and should generally work fine.
544
548
If you encounter any difficulties, consider disabling ` mold ` as a
545
549
troubleshooting step.
@@ -575,17 +579,26 @@ export CXX="ccache c++" # add to ~/.zshrc or other shell config file
575
579
576
580
On Windows:
577
581
578
- Tips: follow < https://github.com/ccache/ccache/wiki/MS-Visual-Studio > , and you
579
- should notice that obj file will be bigger the normal one.
582
+ Follow < https://github.com/ccache/ccache/wiki/MS-Visual-Studio > , and you
583
+ should notice that obj file will be bigger than the normal one.
580
584
581
- First, install ccache, assume ccache install to c:\ccache, copy
582
- c:\ccache\ccache.exe to c:\ccache\cl.exe with this command
585
+ First, install ccache. Assuming the installation of ccache is in ` c:\ccache `
586
+ (where you can find ` ccache.exe ` ), copy ` c:\ccache\ccache.exe ` to ` c:\ccache\cl.exe `
587
+ with this command.
583
588
584
589
``` powershell
585
590
cp c:\ccache\ccache.exe c:\ccache\cl.exe
586
591
```
587
592
588
- When building Node.js provide a path to your ccache via the option
593
+ With newer version of Visual Studio, it may need the copy to be ` clang-cl.exe `
594
+ instead. If the output of ` vcbuild.bat ` suggestion missing ` clang-cl.exe ` , copy
595
+ it differently:
596
+
597
+ ``` powershell
598
+ cp c:\ccache\ccache.exe c:\ccache\clang-cl.exe
599
+ ```
600
+
601
+ When building Node.js, provide a path to your ccache via the option:
589
602
590
603
``` powershell
591
604
.\vcbuild.bat ccache c:\ccache\
@@ -594,6 +607,14 @@ When building Node.js provide a path to your ccache via the option
594
607
This will allow for near-instantaneous rebuilds when switching branches back
595
608
and forth that were built with cache.
596
609
610
+ To use it with ClangCL, run this instead:
611
+
612
+ ``` powershell
613
+ .\vcbuild.bat clang-cl ccache c:\ccache\
614
+ ```
615
+
616
+ ##### Loading JS files from disk instead of embedding
617
+
597
618
When modifying only the JS layer in ` lib ` , it is possible to externally load it
598
619
without modifying the executable:
599
620
@@ -678,14 +699,19 @@ Optional requirements for compiling for Windows on ARM (ARM64):
678
699
* Visual C++ ATL for ARM64
679
700
* Windows 10 SDK 10.0.17763.0 or newer
680
701
681
- Optional requirements for compiling with ClangCL:
702
+ Optional requirements for compiling with ClangCL (search for ` clang ` in Visual Studio
703
+ Installer's "individual component" tab):
682
704
683
- * Visual Studio optional components
705
+ * Visual Studio individual components
684
706
* C++ Clang Compiler for Windows
685
707
* MSBuild support for LLVM toolset
686
708
687
709
NOTE: Currently we only support compiling with Clang that comes from Visual Studio.
688
710
711
+ When building with ClangCL, if the output from ` vcbuild.bat ` shows that the components are not installed
712
+ even when the Visual Studio Installer shows that they are installed, try removing the components
713
+ first and then reinstalling them again.
714
+
689
715
##### Option 2: Automated install with WinGet
690
716
691
717
[ WinGet configuration files] ( https://github.com/nodejs/node/tree/main/.configurations )
0 commit comments