Skip to content

Commit

Permalink
Build with clang-cl
Browse files Browse the repository at this point in the history
  • Loading branch information
prikolium-cfx committed Aug 20, 2024
1 parent 23dbe5b commit eea21ea
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
git apply --reject --whitespace=fix ../patches/internal_modules.patch
git apply --reject --whitespace=fix ../patches/rename_output.patch
git apply --reject --whitespace=fix ../patches/version_suffix.patch
git apply --reject --whitespace=fix ../patches/build_vs_2022.patch
- name: Build project
if: runner.os != 'Windows'
Expand All @@ -59,7 +60,7 @@ jobs:
if: runner.os == 'Windows'
shell: bash
working-directory: ./node
run: ./vcbuild.bat release x64 dll no-cctest
run: ./vcbuild.bat release x64 dll no-cctest clang-cl

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -80,10 +81,10 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: |
${{ github.workspace }}/libnode-Windows-x64/libnode20.dll
${{ github.workspace }}/libnode-Windows-x64/libnode20.lib
${{ github.workspace }}/libnode-Windows-x64/libnode20.pdb
${{ github.workspace }}/libnode-Linux-x64/libnode20.so
${{ github.workspace }}/libnode-Windows-x64/libnode22.dll
${{ github.workspace }}/libnode-Windows-x64/libnode22.lib
${{ github.workspace }}/libnode-Windows-x64/libnode22.pdb
${{ github.workspace }}/libnode-Linux-x64/libnode22.so
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v5
Expand Down
21 changes: 21 additions & 0 deletions patches/build_vs_2022.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git forkSrcPrefix/vcbuild.bat forkDstPrefix/vcbuild.bat
index 428577c5c3d1e9ab55285d7d985fc06ec0ac1dd4..562588ade19d7688a5fd260a38b9ecff10a537bb 100644
--- forkSrcPrefix/vcbuild.bat
+++ forkDstPrefix/vcbuild.bat
@@ -283,11 +283,11 @@ goto exit

@rem Visual Studio v17.10 has a bug that causes the build to fail.
@rem Check if the version is v17.10 and exit if it is.
-echo %VSCMD_VER% | findstr /b /c:"17.10" >nul
-if %errorlevel% neq 1 (
- echo Node.js doesn't compile with Visual Studio 17.10 Please use a different version.
- goto exit
-)
+@rem echo %VSCMD_VER% | findstr /b /c:"17.10" >nul
+@rem if %errorlevel% neq 1 (
+@rem echo Node.js doesn't compile with Visual Studio 17.10 Please use a different version.
+@rem goto exit
+@rem )

@rem check if the clang-cl build is requested
if not defined clang_cl goto clang-skip
4 changes: 2 additions & 2 deletions patches/enable_rtti.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git forkSrcPrefix/common.gypi forkDstPrefix/common.gypi
index 32a298414b5392f0d083f573f129fdc6dac85cfd..9fb52bf9a6242d0437c4d6c333748899d41e370e 100644
index 32a298414b5392f0d083f573f129fdc6dac85cfd..4bfda1278552aaf3364b2c9612e205040eb9e464 100644
--- forkSrcPrefix/common.gypi
+++ forkDstPrefix/common.gypi
@@ -489,7 +489,7 @@
}],
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
- 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ],
+ 'cflags_cc': [ '-fno-exceptions' ],
+ 'cflags_cc': [ '-fno-exceptions', '-std=gnu++20' ],
'defines': [ '__STDC_FORMAT_MACROS' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
Expand Down

0 comments on commit eea21ea

Please sign in to comment.