Skip to content

Commit fd6184c

Browse files
build,win: compile with clang (#3932)
Added support for compiling with ClangCL from v23. Stopped compiling v20 with VS2022 since it was temporary
1 parent 8b8e384 commit fd6184c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

jenkins/scripts/VersionSelectorScript.groovy

+3-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ def buildExclusions = [
5858
[ /vs2015(-\w+)?$/, testType, gte(18) ],
5959
[ /vs2017(-\w+)?$/, testType, gte(18) ],
6060
[ /vs2019(-\w+)?$/, testType, gte(21) ],
61-
[ /vs2022(-\w+)?$/, testType, lt(20) ], // Temporarily compile Node v20+ on both VS2019 and VS2022
62-
[ /vs2022-x86$/, testType, lt(20) ], // Temporarily compile Node v20+ arm64 and x86 on both VS2019 and VS2022
63-
[ /vs2022-x86$/, testType, gte(23) ],
64-
[ /vs2022-arm64$/, testType, lt(20) ],
61+
[ /vs2022(-\w+)?$/, testType, lt(21) ],
62+
[ /vs2022-x86$/, testType, gte(23) ], // x86 was dropped on Windows in v23
63+
[ /vs2022_clang(-\w+)?$/, testType, lt(23) ], // ClangCL support was added in v23
6564
[ /COMPILED_BY-\w+-arm64$/, testType, lt(20) ], // run tests on arm64 for >=19
6665
// VS versions supported to build add-ons
6766
[ /vs2015-COMPILED_BY/, testType, gte(20) ],

jenkins/scripts/windows/compile.cmd

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ if %NODEJS_MAJOR_VERSION% leq 12 set "PATH=C:\Python27\;C:\Python27\Scripts;%PAT
44
:: Opt-in for a generating binlog (work with code has https://github.com/nodejs/node/pull/26431/files)
55
set "msbuild_args=/binaryLogger:node.binlog"
66

7+
:: Check if compiler is ClangCL
8+
echo %nodes% | findstr /R "_clang" >nul
9+
set "not_clang=%errorlevel%"
10+
711
:: Opt-in for a clcache
8-
if not defined DISABLE_CLCACHE if exist C:\clcache\dist\clcache_main\clcache_main.exe (
12+
if %not_clang% equ 1 if not defined DISABLE_CLCACHE if exist C:\clcache\dist\clcache_main\clcache_main.exe (
913
set CLCACHE_OBJECT_CACHE_TIMEOUT_MS=60000
1014
set CLCACHE_BASEDIR="%WORKSPACE%"
1115
set CLCACHE_HARDLINK=1
@@ -50,6 +54,9 @@ if "%nodes:~-6%" == "-arm64" (
5054
) else (
5155
set "VCBUILD_EXTRA_ARGS=x64 %VCBUILD_EXTRA_ARGS%"
5256
)
57+
if %not_clang% equ 0 (
58+
set "VCBUILD_EXTRA_ARGS=%VCBUILD_EXTRA_ARGS% clang-cl"
59+
)
5360
set DEBUG_HELPER=1
5461
call vcbuild.bat %VCBUILD_EXTRA_ARGS%
5562
if errorlevel 1 exit /b

0 commit comments

Comments
 (0)