Skip to content

Commit 75fa377

Browse files
committed
Add macOS x64 GCC compiler support
1 parent 71587eb commit 75fa377

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/build_node_shared.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ jobs:
2929
lib_name: libnode.so.127
3030
nproc_cmd: nproc
3131
# macOS x64 builds
32+
- os: macos-13
33+
platform: mac
34+
arch: x64
35+
compiler: gcc
36+
container: ""
37+
lib_name: libnode.127.dylib
38+
nproc_cmd: sysctl -n hw.ncpu
3239
- os: macos-13
3340
platform: mac
3441
arch: x64
@@ -53,11 +60,21 @@ jobs:
5360
with:
5461
python-version: '3.11'
5562

63+
- name: Install GCC (macOS)
64+
if: matrix.platform == 'mac' && matrix.compiler == 'gcc'
65+
run: |
66+
brew install gcc@13
67+
echo "CC=$(brew --prefix gcc@13)/bin/gcc-13" >> $GITHUB_ENV
68+
echo "CXX=$(brew --prefix gcc@13)/bin/g++-13" >> $GITHUB_ENV
69+
5670
- name: Configure and Build
5771
run: |
5872
if [ "${{ matrix.compiler }}" = "gcc" ]; then
59-
export CC=gcc
60-
export CXX=g++
73+
# CC and CXX already set for macOS GCC via GITHUB_ENV
74+
if [ "${{ matrix.platform }}" != "mac" ]; then
75+
export CC=gcc
76+
export CXX=g++
77+
fi
6178
else
6279
export CC=clang
6380
export CXX=clang++

0 commit comments

Comments
 (0)