Skip to content

Commit 15300a0

Browse files
authored
Merge pull request #72 from luavela/imun/enable-macos-13
Upgrade to macOS 13 in GitHub Actions
2 parents 52858bc + be14cfd commit 15300a0

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/macos.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
BUILDTYPE: [Debug, Release]
41-
DISTVER: [12]
41+
DISTVER: [13]
4242
include:
4343
- BUILDTYPE: Debug
4444
CMAKEFLAGS: >-
@@ -62,3 +62,4 @@ jobs:
6262
uses: ./.github/actions/run-tests
6363
with:
6464
cmakeflags: ${{ matrix.CMAKEFLAGS }}
65+
toolchain: cmake/toolchain/MacOS.cmake

cmake/toolchain/MacOS.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MacOS toolchain for building uJIT. To enable, run cmake like this:
2+
#
3+
# $ cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/MacOS.cmake ...other options...
4+
#
5+
# Copyright (C) 2020-2024 LuaVela Authors. See Copyright Notice in COPYRIGHT
6+
# Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
7+
8+
# XXX: Clang 15 changes the behaviour of -Wnull-pointer-arithmetics to control
9+
# -Wgnu-null-pointer-arithmetics either. Since uJIT is built with -Wextra
10+
# (including -Wnull-pointer-arithmetics) and -Werror flags being set in
11+
# CMAKE_C_FLAGS list, compilation of src/utils/lj_alloc.c fails due to NULL
12+
# pointer arithmetics in TOP_FOOT_SIZE constant definition. Furthermore,
13+
# -Wno-gnu flag to silence GNU extension diagnostics for pointer arithmetic is
14+
# allowed since Clang 15 (https://github.com/llvm/llvm-project/issues/54444)
15+
# too. Considering everything above, tweak the CMAKE_C_FLAGS list for Clang
16+
# toolchain only for Clang 15.0.0 and later.
17+
# XXX: Unlike Linux distributions, we only support one version of macOS, so the
18+
# compiler to be used is well-defined.
19+
# Taking into account all of the above, just provide a tiny tweak for
20+
# CMAKE_C_FLAGS, nothing more.
21+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-null-pointer-arithmetic")

0 commit comments

Comments
 (0)