Skip to content

Commit eea21ea

Browse files
committed
Build with clang-cl
1 parent 23dbe5b commit eea21ea

3 files changed

Lines changed: 29 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
git apply --reject --whitespace=fix ../patches/internal_modules.patch
3939
git apply --reject --whitespace=fix ../patches/rename_output.patch
4040
git apply --reject --whitespace=fix ../patches/version_suffix.patch
41+
git apply --reject --whitespace=fix ../patches/build_vs_2022.patch
4142
4243
- name: Build project
4344
if: runner.os != 'Windows'
@@ -59,7 +60,7 @@ jobs:
5960
if: runner.os == 'Windows'
6061
shell: bash
6162
working-directory: ./node
62-
run: ./vcbuild.bat release x64 dll no-cctest
63+
run: ./vcbuild.bat release x64 dll no-cctest clang-cl
6364

6465
- name: Upload artifacts
6566
uses: actions/upload-artifact@v4
@@ -80,10 +81,10 @@ jobs:
8081
uses: softprops/action-gh-release@v2
8182
with:
8283
files: |
83-
${{ github.workspace }}/libnode-Windows-x64/libnode20.dll
84-
${{ github.workspace }}/libnode-Windows-x64/libnode20.lib
85-
${{ github.workspace }}/libnode-Windows-x64/libnode20.pdb
86-
${{ github.workspace }}/libnode-Linux-x64/libnode20.so
84+
${{ github.workspace }}/libnode-Windows-x64/libnode22.dll
85+
${{ github.workspace }}/libnode-Windows-x64/libnode22.lib
86+
${{ github.workspace }}/libnode-Windows-x64/libnode22.pdb
87+
${{ github.workspace }}/libnode-Linux-x64/libnode22.so
8788
8889
- name: Delete artifacts
8990
uses: geekyeggo/delete-artifact@v5

patches/build_vs_2022.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git forkSrcPrefix/vcbuild.bat forkDstPrefix/vcbuild.bat
2+
index 428577c5c3d1e9ab55285d7d985fc06ec0ac1dd4..562588ade19d7688a5fd260a38b9ecff10a537bb 100644
3+
--- forkSrcPrefix/vcbuild.bat
4+
+++ forkDstPrefix/vcbuild.bat
5+
@@ -283,11 +283,11 @@ goto exit
6+
7+
@rem Visual Studio v17.10 has a bug that causes the build to fail.
8+
@rem Check if the version is v17.10 and exit if it is.
9+
-echo %VSCMD_VER% | findstr /b /c:"17.10" >nul
10+
-if %errorlevel% neq 1 (
11+
- echo Node.js doesn't compile with Visual Studio 17.10 Please use a different version.
12+
- goto exit
13+
-)
14+
+@rem echo %VSCMD_VER% | findstr /b /c:"17.10" >nul
15+
+@rem if %errorlevel% neq 1 (
16+
+@rem echo Node.js doesn't compile with Visual Studio 17.10 Please use a different version.
17+
+@rem goto exit
18+
+@rem )
19+
20+
@rem check if the clang-cl build is requested
21+
if not defined clang_cl goto clang-skip

patches/enable_rtti.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
diff --git forkSrcPrefix/common.gypi forkDstPrefix/common.gypi
2-
index 32a298414b5392f0d083f573f129fdc6dac85cfd..9fb52bf9a6242d0437c4d6c333748899d41e370e 100644
2+
index 32a298414b5392f0d083f573f129fdc6dac85cfd..4bfda1278552aaf3364b2c9612e205040eb9e464 100644
33
--- forkSrcPrefix/common.gypi
44
+++ forkDstPrefix/common.gypi
55
@@ -489,7 +489,7 @@
66
}],
77
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
88
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
99
- 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ],
10-
+ 'cflags_cc': [ '-fno-exceptions' ],
10+
+ 'cflags_cc': [ '-fno-exceptions', '-std=gnu++20' ],
1111
'defines': [ '__STDC_FORMAT_MACROS' ],
1212
'ldflags': [ '-rdynamic' ],
1313
'target_conditions': [

0 commit comments

Comments
 (0)