Skip to content

Commit

Permalink
build,win: compile with clang
Browse files Browse the repository at this point in the history
Added support for compiling with ClangCL from v23.
Stopped compiling v20 with VS2022 since it was temporary
  • Loading branch information
StefanStojanovic committed Oct 9, 2024
1 parent 639b70e commit c525460
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 3 additions & 4 deletions jenkins/scripts/VersionSelectorScript.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ def buildExclusions = [
[ /vs2015(-\w+)?$/, testType, gte(18) ],
[ /vs2017(-\w+)?$/, testType, gte(18) ],
[ /vs2019(-\w+)?$/, testType, gte(21) ],
[ /vs2022(-\w+)?$/, testType, lt(20) ], // Temporarily compile Node v20+ on both VS2019 and VS2022
[ /vs2022-x86$/, testType, lt(20) ], // Temporarily compile Node v20+ arm64 and x86 on both VS2019 and VS2022
[ /vs2022-x86$/, testType, gte(23) ],
[ /vs2022-arm64$/, testType, lt(20) ],
[ /vs2022(-\w+)?$/, testType, lt(21) ],
[ /vs2022-x86$/, testType, gte(23) ], // x86 was dropped on Windows in v23
[ /vs2022_clang(-\w+)?$/, testType, lt(23) ], // ClangCL support was added in v23
[ /COMPILED_BY-\w+-arm64$/, testType, lt(20) ], // run tests on arm64 for >=19
// VS versions supported to build add-ons
[ /vs2015-COMPILED_BY/, testType, gte(20) ],
Expand Down
9 changes: 8 additions & 1 deletion jenkins/scripts/windows/compile.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ if %NODEJS_MAJOR_VERSION% leq 12 set "PATH=C:\Python27\;C:\Python27\Scripts;%PAT
:: Opt-in for a generating binlog (work with code has https://github.com/nodejs/node/pull/26431/files)
set "msbuild_args=/binaryLogger:node.binlog"

:: Check if compiler is ClangCL
echo %nodes% | findstr /R "_clang" >nul
set "not_clang=%errorlevel%"

:: Opt-in for a clcache
if not defined DISABLE_CLCACHE if exist C:\clcache\dist\clcache_main\clcache_main.exe (
if %not_clang% equ 1 if not defined DISABLE_CLCACHE if exist C:\clcache\dist\clcache_main\clcache_main.exe (
set CLCACHE_OBJECT_CACHE_TIMEOUT_MS=60000
set CLCACHE_BASEDIR="%WORKSPACE%"
set CLCACHE_HARDLINK=1
Expand Down Expand Up @@ -50,6 +54,9 @@ if "%nodes:~-6%" == "-arm64" (
) else (
set "VCBUILD_EXTRA_ARGS=x64 %VCBUILD_EXTRA_ARGS%"
)
if %not_clang% equ 0 (
set "VCBUILD_EXTRA_ARGS=%VCBUILD_EXTRA_ARGS% clang-cl"
)
set DEBUG_HELPER=1
call vcbuild.bat %VCBUILD_EXTRA_ARGS%
if errorlevel 1 exit /b
Expand Down

0 comments on commit c525460

Please sign in to comment.