Skip to content

doc,build,win: update docs with clang #57991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,10 @@ Refs:
[Visual Studio 2022 (17.6 or newer)](https://visualstudio.microsoft.com/downloads/)
or the "C++ build tools" workload from the
[Build Tools](https://aka.ms/vs/17/release/vs_buildtools.exe),
with the default optional components
with the default optional components. Starting with Node.js v24, ClangCL is required to compile
on Windows. To enable it, two additional components are needed:
* C++ Clang Compiler for Windows (Microsoft.VisualStudio.Component.VC.Llvm.Clang)
* MSBuild support for LLVM toolset (Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset)
* Basic Unix tools required for some tests,
[Git for Windows](https://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
Expand All @@ -664,13 +667,6 @@ Optional requirements for compiling for Windows on ARM (ARM64):
* Visual C++ ATL for ARM64
* Windows 10 SDK 10.0.17763.0 or newer

Optional requirements for compiling with ClangCL (search for `clang` in Visual Studio
Installer's "individual component" tab):

* Visual Studio individual components
* C++ Clang Compiler for Windows
* MSBuild support for LLVM toolset

NOTE: Currently we only support compiling with Clang that comes from Visual Studio.

When building with ClangCL, if the output from `vcbuild.bat` shows that the components are not installed
Expand Down
2 changes: 1 addition & 1 deletion tools/bootstrap/windows_boxstarter
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ choco install python3 -y

# Installs VS 2022 Build Tools
choco install visualstudio2022buildtools -y
choco install visualstudio2022-workload-vctools -y --params="--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64"
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"

# NASM
choco install nasm -y
8 changes: 8 additions & 0 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ if errorlevel 1 echo Could not find NASM, install it or build with openssl-no-as

call :getnodeversion || exit /b 1

@REM Forcing ClangCL usage for version 24 and above
set NODE_MAJOR_VERSION=
for /F "tokens=1 delims=." %%i in ("%NODE_VERSION%") do set "NODE_MAJOR_VERSION=%%i"
if %NODE_MAJOR_VERSION% GEQ 24 (
echo Using ClangCL because the Node.js version being compiled is >= 24.
set clang_cl=1
)

if defined TAG set configure_flags=%configure_flags% --tag=%TAG%

if not "%target%"=="Clean" goto skip-clean
Expand Down
Loading