Skip to content

Commit 2244a09

Browse files
doc,build,win: update docs with clang
Updated BUILDING.md to make ClangCL mandatory for new versions of Node. Forcing clang-cl flag in vcbuild if not specified, thus disabling MSVC. PR-URL: #57991 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent e61aa0c commit 2244a09

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

BUILDING.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,10 @@ Refs:
634634
[Visual Studio 2022 (17.6 or newer)](https://visualstudio.microsoft.com/downloads/)
635635
or the "C++ build tools" workload from the
636636
[Build Tools](https://aka.ms/vs/17/release/vs_buildtools.exe),
637-
with the default optional components
637+
with the default optional components. Starting with Node.js v24, ClangCL is required to compile
638+
on Windows. To enable it, two additional components are needed:
639+
* C++ Clang Compiler for Windows (Microsoft.VisualStudio.Component.VC.Llvm.Clang)
640+
* MSBuild support for LLVM toolset (Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset)
638641
* Basic Unix tools required for some tests,
639642
[Git for Windows](https://git-scm.com/download/win) includes Git Bash
640643
and tools which can be included in the global `PATH`.
@@ -658,13 +661,6 @@ Optional requirements for compiling for Windows on ARM (ARM64):
658661
* Visual C++ ATL for ARM64
659662
* Windows 10 SDK 10.0.17763.0 or newer
660663

661-
Optional requirements for compiling with ClangCL (search for `clang` in Visual Studio
662-
Installer's "individual component" tab):
663-
664-
* Visual Studio individual components
665-
* C++ Clang Compiler for Windows
666-
* MSBuild support for LLVM toolset
667-
668664
NOTE: Currently we only support compiling with Clang that comes from Visual Studio.
669665

670666
When building with ClangCL, if the output from `vcbuild.bat` shows that the components are not installed

tools/bootstrap/windows_boxstarter

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ choco install python3 -y
1818

1919
# Installs VS 2022 Build Tools
2020
choco install visualstudio2022buildtools -y
21-
choco install visualstudio2022-workload-vctools -y --params="--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64"
21+
choco install visualstudio2022-workload-vctools -y --params="--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.NetCore.Component.SDK --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset"
2222

2323
# NASM
2424
choco install nasm -y

vcbuild.bat

+8
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ if errorlevel 1 echo Could not find NASM, install it or build with openssl-no-as
237237

238238
call :getnodeversion || exit /b 1
239239

240+
@REM Forcing ClangCL usage for version 24 and above
241+
set NODE_MAJOR_VERSION=
242+
for /F "tokens=1 delims=." %%i in ("%NODE_VERSION%") do set "NODE_MAJOR_VERSION=%%i"
243+
if %NODE_MAJOR_VERSION% GEQ 24 (
244+
echo Using ClangCL because the Node.js version being compiled is >= 24.
245+
set clang_cl=1
246+
)
247+
240248
if defined TAG set configure_flags=%configure_flags% --tag=%TAG%
241249

242250
if not "%target%"=="Clean" goto skip-clean

0 commit comments

Comments
 (0)