Skip to content

Commit 304f164

Browse files
StefanStojanovicRafaelGSS
authored andcommitted
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 <rlau@redhat.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent d24414c commit 304f164

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

BUILDING.md

Lines changed: 4 additions & 8 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ if errorlevel 1 echo Could not find NASM, install it or build with openssl-no-as
240240

241241
call :getnodeversion || exit /b 1
242242

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

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy